2017-02-11 56 views
0

我試圖讓一個屏幕,我建立正確的佈局: enter image description hereTableLayout VS的LinearLayout

基本上從我已閱讀,它似乎是最好的辦法是使用屏幕一分爲二一個TableLayout,並在每個地方一個LinearLayout。

我試圖完成某件事情,但鑑於我沒有Xamarin開發背景,事情有點棘手,我主要是BE開發人員。

回答

1

基本上從我已閱讀,它似乎是最好的辦法是到屏幕兩種使用TableLayout和各地方的LinearLayout內分裂。

這不是必須使用TableLayout。你也可以使用一個LinearLayout作爲底板和兩個LinearLayout S作爲子板:

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="horizontal" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <LinearLayout 
     android:layout_width="0dp" 
     android:layout_weight="1" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 
     <!--You contents here--> 
    </LinearLayout> 
    <LinearLayout 
     android:layout_width="0dp" 
     android:layout_weight="1" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 
     <!--You contents here--> 
    </LinearLayout> 
</LinearLayout> 

注:棘手的事情是通過設置子LinearLayout S'layout_width0dplayout_weight 1,讓他們共享寬度比例爲1:1。

+0

謝謝埃爾維斯,這個伎倆。 – Marco