2016-09-04 7 views
0

enter image description here相対レイアウトで囲まれた線形レイアウトのページの半分の幅でボタンをどのように設定するのですか?

これは私のアプリケーションであり、それは【選択事は、私が以前と相対レイアウトで囲まれ、画面の一番下(線形レイアウト)の横のボタンを設定したいです多くのページがあります。私はアプリケーション全体の相対的なレイアウトを使用する場合は、ボタンの幅がページの半分の幅にならないように設定重量を傾けるlayout_weightプロパティのために使用する必要があるのは

答えて

0

です。

あなたのLinearLayoutでは、この方法で設定します。

<LinearLayout 
     android:id="@+id/btnLinearLayout" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true"> 
    <Button 
     android:id="@+id/prevButton" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:text="Prev" /> 

    <Button 
     android:id="@+id/nextButton" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:text="Next"/> 
    </LinearLayout> 
関連する問題