如何创建动态的我喜欢的按钮在我设计的Android [英] How create I dynamic buttons like my design in Android
问题描述
我可以创建动态按钮类似的第一张照片。我现在用的TableRow通过创建按钮类似的第一张照片。我得到的数据库值,那么我设置按钮的文本值。因此,按钮的文本价值是动态的。由于按钮的文本值是同一时间长,同一时间短,所以按钮的宽度是动态的。正因为如此,我不能使用的GridView。
I can create dynamic buttons similar first picture now .I used Tablerow by create buttons similar first picture . I get database value then I set button's text values . So Button's text values is dynamic. Because button's text values is same time long, same time short so Button's width is dynamic. Because of this, I can not use Gridview.
最后,我想创建动态按钮类似的第二张照片的设计。我该怎么办?
Finally I want to create dynamic buttons similar second picture design. How can I do?
推荐答案
在Android中,你可以定义一个布局不同的屏幕方向,像
In Android you can define a layout for different screen orientations, like
MyProject/
res/
layout/
activity.xml
layout-land/
activity.xml
和系统将根据屏幕方向显示正确政绩观的关怀
And the system will take care of displaying the correct view based on the screen orientation
这篇关于如何创建动态的我喜欢的按钮在我设计的Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!