什么是最好的布局用于显示一系列的图像按钮,并排(如附图所示),并将在屏幕水平方向填充屏幕时水平改变(如附件)?android最佳布局显示图像按钮,将填满屏幕
horizontal orientation http://img254.imageshack.us/img254/657/layoutxs.png vertical orientation http://img208.imageshack.us/img208/2428/layouthy.png
什么是最好的布局用于显示一系列的图像按钮,并排(如附图所示),并将在屏幕水平方向填充屏幕时水平改变(如附件)?android最佳布局显示图像按钮,将填满屏幕
horizontal orientation http://img254.imageshack.us/img254/657/layoutxs.png vertical orientation http://img208.imageshack.us/img208/2428/layouthy.png
<GridView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:numColumns="auto_fit" >
</GridView>
它看起来像你想使用类似的FlowLayout,它不存在的Android。不过,你可以自己制作。更多信息
我与你类似的布局的活动,但我用不同的方法。我所做的是为横向和纵向定义不同的xml布局。所以我有layout-port/mylayout.xml
和layout-land/mylayout.xml
,系统决定哪个活动应该使用。
只需创建两个单独的布局文件并在您的onOrientationChanged()中调用setContentView()。