我要放一个图像,在倒计时的前面(首先出现倒计时,倒计时的向下将出现一个图像)
我有这样的代码:
new CountDownTimer(30000, 1000) {
public void onTick(long millisUntilFinished) {
mTextField.setText("seconds remaining: " + millisUntilFinished / 1000);
}
public void onFinish() {
mTextField.setText("done!");
}
}.start();这是倒计时,但当我放置一个图像,倒计时出现在图像,我没有看到倒计时D:谢谢和对不起我的英语:)
发布于 2013-12-03 22:14:03
您可以使用布局xml文件中的RelativeLayout轻松地解决这个问题。
首先,设置ImageView,然后使用TextView的id对齐ImageView。结果将是一个覆盖了ImageView的TextView。
在下面的示例中,使用layout_alignLeft="@+id/image"将TextView对齐到ImageView的左边。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/image"
android:text="My Countdown"
/>
</RelativeLayout>发布于 2013-12-03 21:54:51
我认为u'r图像在Textfiles上。查看u'r xml
https://stackoverflow.com/questions/20362301
复制相似问题