10
<include>
タグを使用して、アンドロイドアプリケーションのレイアウトコンポーネントを再利用しようとしています。私は別のポートと土地のレイアウトを持っている:layout_weight属性の<include>タグ
ポート:
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp"> <include layout="@layout/calc_equals_button" a:layout_weight="4"/> <include layout="@layout/calc_display"/> </LinearLayout>
ランド:
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp"> <include layout="@layout/calc_equals_button"/> <include layout="@layout/calc_display"/> </LinearLayout>
が主な違いは、a:layout_weight="4"
あるので、私は自分が欲しいですcalc_equals_buttonコンポーネントのポート方向が小さくなるようにします。ません - 私は、そうでない場合は、直接、すべてがOKに動作calc_equals_button
部品、例えば:
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<DirectionDragButton
xmlns:a="http://schemas.android.com/apk/res/android"
a:id="@+id/equalsButton"
a:text="="
a:layout_width="match_parent"
a:layout_height="match_parent"
a:layout_weight="4"
style="@style/control_button_style"
a:onClick="numericButtonClickHandler"/>
<include layout="@layout/calc_display"/>
</LinearLayout>
を埋め込むしようとした場合
事があります。ここで
はcalc_equals_button.xmlのサンプルです:
<DirectionDragButton
xmlns:a="http://schemas.android.com/apk/res/android"
a:id="@+id/equalsButton"
a:text="="
a:layout_width="match_parent"
a:layout_height="match_parent"
style="@style/control_button_style"
a:onClick="numericButtonClickHandler"/>
「Current」はICSで変更されますか? –
これがどのように問題に役立つのでしょうか? –
@MichellBakいいえ、この制限はまだICSにあります。 –