简体   繁体   English

attr / buttonBarStyle不显示顶部除法器

[英]attr/buttonBarStyle does not show top Divider

I am using ?android:attr/buttonBarStyle and ?android:attr/buttonBarButtonStyle for my button bar. 我在按钮栏上使用?android:attr / buttonBarStyle和?android:attr / buttonBarButtonStyle。

Here is my code: 这是我的代码:

    <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>

Here is result I get: 这是我得到的结果:

在此处输入图片说明

I expected to see a Divider between my button bar and other views but I didn't see it. 我期望在按钮栏和其他视图之间看到分隔线,但没有看到。 I see top Divider when I am using AlertDialog - I checked AlertDialog xml layout and saw that AlertDialog also use buttonBarStyle. 当我使用AlertDialog时,我看到了顶级Divider-我检查了AlertDialog的xml布局,并看到AlertDialog也使用buttonBarStyle。 Anyone has any ideas? 有人有什么想法吗? Thanks! 谢谢!

Here is dev settings: Eclipse + Nexus 4 Simulator + Min API is 14+ 这是开发人员设置:Eclipse + Nexus 4 Simulator + Min API为14+

The ButtonBarStyle does not (as far as I know) provide dividers. (据我所知),ButtonBarStyle不提供分隔符。 To create such a divider, you will need to add them as Views in your layout (see this question for more). 要创建这样的分隔线,您需要将它们添加为布局中的“视图”(有关更多信息,请参见此问题 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM