gpt4 book ai didi

java - 如何在Android Studio中显示几分钟后显示隐藏内容

转载 作者:太空宇宙 更新时间:2023-11-04 13:35:48 25 4
gpt4 key购买 nike

我正在开发的应用程序是一个游戏。我想要做的是我希望下面的布局使用react,以便一旦单击圆圈,就会显示隐藏的内容。我会谦虚地欣赏一个小演示,使用一个按钮来显示圆圈中的隐藏内容。提前致谢。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:shape="oval"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/back1"
tools:context=".MainScreen">



<View
android:id="@+id/image1"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="@drawable/circle"
android:layout_below="@+id/image4"
android:layout_alignLeft="@+id/image2"
android:layout_alignStart="@+id/image2"
android:layout_marginTop="67dp" />

</RelativeLayout>

最佳答案

我建议您使用 ImageButton 并在 onClickListener 中使项目可见,如下所示

ImageButton ib = (ImageButton) findViewById(R.id.your_button);
ib.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
your_hidden_item.setVisibility(View.Visible);
}
});

关于java - 如何在Android Studio中显示几分钟后显示隐藏内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31709271/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com