2015-03-30 96 views
-1

我现在可以创建类似第一张图片的动态按钮。我通过创建类似第一张图片的按钮来使用Tablerow。我获得数据库值,然后设置按钮的文本值。所以Button的文本值是动态的。因为按钮的文本值是相同的时间长,同时短,所以Button的宽度是动态的。因此,我不能使用Gridview。如何创建像我在Android设计中的动态按钮

最后我想创建类似于第二个图片设计的动态按钮。我能怎么做?

enter image description here

enter image description here

+1

检查这个链接它会帮助你 http://stackoverflow.com/questions/2124046/how-do-i-specify-different-layouts-for-portrait-and-landscape-orientations – 2015-03-30 18:00:29

回答

0

在Android中,您可以定义不同的屏幕方向的布局,像

MyProject/ 
res/ 
    layout/ 
     activity.xml 
    layout-land/ 
     activity.xml 

而且系统会根据屏幕方向显示正确政绩观的护理