开发者

Android right-left justification of view element in layout

开发者 https://www.devze.com 2023-02-11 21:50 出处:网络
开发者_如何学GoHow do you get a view to position itself left, right and center in a TableLayout row? Or linear layout?You can use the android:gravity property to set the alignment you want.
开发者_如何学Go

How do you get a view to position itself left, right and center in a TableLayout row? Or linear layout?


You can use the android:gravity property to set the alignment you want.

<TableRow android:gravity="center">
    <LinearLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:gravity="center">
    </LinearLayout>
</TableRow>

When working on the TableLayout, look for the streachColoum property. Also make it * if you want all the table columns to auto fit.

0

精彩评论

暂无评论...
验证码 换一张
取 消