同じレイアウトの2つのボタンを直線レイアウトに配置しようとしました。私の問題は、左ボタンが正しいボタンと同じ高さにないことです。linearlayoutのlayout_weightとlayout_width = 0dpが予期しないレイアウトを作成する
私は答えを探しましたが、私の問題に関連するものは見つかりませんでした。ここ
私はアンドロイド2.1デバイス上で何を得るの絵:あなたの助け `
<LinearLayout
android:layout_alignParentBottom="true"
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom">
<Button
android:id="@+id/take_pic_btn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/take_pic" />
<Button
android:id="@+id/from_gallery_btn"
android:text="@string/from_gallery"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>`
感謝:私はこのコードを使用し http://tinypic.com/r/eskb4n/5
!
編集:私は、私は2つの可能な解決策を参照。.. layout_widthの代わりに、fill_parentため
正確に何をしたいですか? –
同じサイズで、利用可能なすべてのスペースを使用する、隣り合う2つのボタンを作成しようとしました –
LadaRaiderで答えが問題を解決しませんでした。しかし、ありがとう!この問題を解決した –