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

标签 java android android-studio

我正在开发的应用程序是一个游戏。我想要做的是我希望下面的布局使用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/

相关文章:

php - 如何使用 Volley 向 Mysql 数据库插入数据

android-studio - 在 android studio 中减少 Flutter 的控制台输出

java - 如果用户单击 IE Pane ,IE 中的模式对话框将隐藏在 IE 后面

android - 如何在单个改造调用中解析不同的 xml 数据

android - ParseQuery Android - 获取项目的位置

android - 带有plyer应用程序的python kivy在android(相机)上崩溃

Android Studio 如何制作一个 2 列的 LinearLayout

java - 当我从 ListActivity 而不是 ActionBarActivity 扩展时,为什么 ActionBar 不显示?

java - 切换到 targetSdkVersion 28 (Android) 时出现 DefaultHttpClient NoClassDefFoundError

java - Jython 和独立数据库连接池 : How to confirm the pool is a Singleton