1
嗨,我正在一个孩子的应用程序中,我想要显示1 + 1 = 2,1 + 2 = 3等应用程序。为此我希望tio逐一显示数字图像。这意味着fiorst显示1后+后一段时间另一个number.For此给我一些建议。请给我一些示例代码。预先感谢显示图像一个接一个
嗨,我正在一个孩子的应用程序中,我想要显示1 + 1 = 2,1 + 2 = 3等应用程序。为此我希望tio逐一显示数字图像。这意味着fiorst显示1后+后一段时间另一个number.For此给我一些建议。请给我一些示例代码。预先感谢显示图像一个接一个
您的idéa是类似于我的Android应用程序中称为学习数学,看起来像这样: alt text http://www.skogberg.eu/android/LearnMathWins.png。
我用个人TableRow
个TableLayout
的图像,像这样:
<TableRow android:layout_marginTop="5dp">
<ImageView android:id="@+id/img1" />
<ImageView android:id="@+id/img2" />
<ImageView android:id="@+id/img3" />
<ImageView android:id="@+id/img4" />
</TableRow>
程序本身具有的图像,这是我改变用户的选择私有变量。最初,它可能是这样的(以下上图中):
public class LearnMath extends Activity {
private ImageView img1, img2, img3, img4;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
img1 = (ImageView)findViewById(R.id.img1);
img2 = (ImageView)findViewById(R.id.img2);
img3 = (ImageView)findViewById(R.id.img3);
img4 = (ImageView)findViewById(R.id.img4);
// .png images located in res/drawable folder with lower case names
img1.setImageResource(R.drawable.six);
img2.setImageResource(R.drawable.plus);
img3.setImageResource(R.drawable.zero);
img4.setImageResource(R.drawable.equals);
}
我希望这给你应用程序的起点!
谢谢你的回复。但我想在eby上显示图像,意思是不在对齐(布局)意义上。我想要显示像视频这样的图像,第一个图像会在一段时间后显示“+”,然后经过一段时间后,另一个数字就像这样。现在你明白了 “ – Pinki 2010-08-04 06:28:41
如果你想添加一个动画到你的软件,可能会试图让UI线程在显示下一个图像之前进入睡眠状态,但这很糟糕编码,而是看看这个地址的UI定时器:http://developer.android.com/resources/articles/timed-ui-updates.html – 2010-08-04 06:36:37