2
我的根佈局是RelativeLayout
,它包含一些TextView,Button和ImageViews。在屏幕的底部,我有一個TableLayout
,它代表了一個4x4的TextViews網格。我想在網格中顯示與每個TextView的右下角對齊的視圖(例如TextView)。Android - 將RelativeLayout中的視圖對齊到TableLayout中的視圖
所以我有一個
<TableLayout ...>
<TableRow ...>
<TextView android:id="@+id/x0y0".../>
<TextView android:id="@+id/x0y1".../>
....
</TableLayout>
...
<TextView android:layout_alignTop="@id/x0y0"
android:layout_alignLeft="@id/x0y0" ... />
<TextView android:layout_alignTop="@id/x1y1"
android:layout_alignLeft="@id/x1y1" ... />
但它位於屏幕的左上角。我懷疑RelativeLayout中的Views只能與同一個RelativeLayout中的另一個視圖對齊,但我希望這個確認或更好的建議來解決這個問題。