【发布时间】:2014-06-06 07:23:47
【问题描述】:
我正在开发一个在其主要布局中具有滚动视图和图像按钮的 Android 应用。我使用 drawable 文件夹中的图像并通过它们的 id 调用它们。
//AboutScreen.java class
private ImageButton mStartButton3;
mStartButton3 = (ImageButton) findViewById(R.id.woops3);
mStartButton3.setOnClickListener(this);
//MainLayout.xml
<ImageButton
android:id="@+id/woops3"
android:background="@android:color/transparent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:gravity="center_horizontal|center_vertical"
android:src="@drawable/woops6"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:text="@string/button_start"
android:textSize="@dimen/menu_title" />
但我想通过在启动画面期间从 json Web 服务下载的图像来更新这些图像(图像按钮)。
可以吗?
谢谢。
【问题讨论】:
标签: android xml user-interface updates imagebutton