ant*_*lla 9 layout android gridview
在我的布局中,我只有八个单元格.
我希望单元格划分屏幕上的所有可用空间.这可能吗?
这是我的gridview布局:
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dataGrid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10px"
android:verticalSpacing="10px"
android:horizontalSpacing="10px"
android:numColumns="2"
android:gravity="fill" />
Run Code Online (Sandbox Code Playgroud)
这是项目布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="6dip" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#E00000"
android:textStyle="bold"
android:gravity="left"
android:textSize="16dip"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#000000"
android:textStyle="normal"
android:gravity="right"
android:textSize="12dip"/>
</LinearLayout>
</TableRow>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
首先,使用PS代替PX。这将允许它扩展到不同的 DPI 设备。
其次,为了使每个单元格的大小均匀,您可以在每个包含清晰图像的单元格中放置一个 tableView。用PS设置图像的大小(不是px)。表格视图应该允许您对每个单元格中的布局对象进行分层,并且清晰的图形应该使所有单元格保持相同的大小。
我还会删除任何填充物。
让我们知道。
| 归档时间: |
|
| 查看次数: |
15158 次 |
| 最近记录: |