android layout.xmlファイルに2行のボタンを作成しようとしています。 最初の行は左揃えで、2番目の行は中央揃えです。android layout.xmlファイルに2行のボタンを作成するには
これは私がやったことですが、私は1行のボタンを得ることになります。私は何が間違っているのか教えていただけますか?
enter code here
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="bottom|left"
>
<Button
android:id="@+id/btn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="bottom|center"
>
<Button
android:id="@+id/btn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/btn3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</FrameLayout>
</pre>
相対レイアウトは、はるかに高価なレイアウトメカニズムです。ソース、Googleエンジニア:https://plus.google.com/+KirillGrouchnikov/posts/fFfm7jKn7q5 –
リンクされた「記事」(文章に近い)は、アダプタ内のレイアウトについて話しています。 OPではこれをアダプターに入れる必要はありません。言葉が聖なる神の口から出てくるからといって、それ以上のことは起こっていないわけではありません。 –