ボタンバーに ?android:attr/buttonBarStyle と ?android:attr/buttonBarButtonStyle を使用しています。
これが私のコードです:
<LinearLayout
android:id="@+id/label_edit_dialog_buttonbar"
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/label_edit_dialog_name_edittext"
android:layout_marginTop="8dp"
android:orientation="horizontal" >
<Button
android:id="@+id/label_edit_dialog_save_button"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/save" />
<Button
android:id="@+id/label_edit_dialog_cancel_button"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/cancel" />
</LinearLayout>
ここに私が得る結果があります:
ボタン バーと他のビューの間に Divider があると思っていましたが、表示されませんでした。AlertDialog を使用しているときに上部の仕切りが表示されます - AlertDialog xml レイアウトを確認したところ、AlertDialog も buttonBarStyle を使用していることがわかりました。誰にもアイデアはありますか?ありがとう!
開発者の設定は次のとおりです: Eclipse + Nexus 4 Simulator + Min API is 14+