2010-01-01 67 views
3

我正在寻找一个视图或某种有关Android默认应用程序(如电子邮件或底下的解锁模式)的底栏的信息,如下图所示。我无法在Android网站或Google搜索中找到任何有关此信息的内容。是否有按钮栏的视图? (描述视图的图片链接)

图片:http://img11.imageshack.us/i/viewdn.jpg/

+0

我打电话重复:http://stackoverflow.com/questions/2127459/which-android-control-to-use/2224638 – 2010-02-10 13:40:10

回答

2

我不相信有在这些应用程序的底部使用按钮栏任何标准视图。通常只有两个Button项目放在一起,即LinearLayoutRelativeLayout

例如,在看Android Open Source Project,可以看到button bar for one of the email app setup screens被定义为两个普通的旧的Button对象。

但是,令人惊讶的是,Google没有将更多的常见内容抽象到Android主题或子布局中,而不是在每个布局XML中具有相同的视图和属性。

7

我相信克里斯托弗是正确的;没有特殊的小部件可以在图像中创建栏。但是,如果要模拟它,可以创建布局并使用样式style="@android:style/ButtonBar"。这会给你浅灰色背景和正确的边距。

+0

酷!以前没有看过那种风格。然而谷歌不会在他们自己的应用中使用它(当然,从我看过的几个版面来看)。 – 2010-01-02 01:47:49

0

来源:http://code.google.com/p/k9mail/source/browse/k9mail/trunk/res/layout/account_setup_basics.xml?r=1314

<RelativeLayout 
     android:layout_marginTop="-45dip" 
     android:padding="0dip" 
     android:layout_alignParentBottom="true" 
     android:gravity="bottom|right" 
     android:background="@android:drawable/bottom_bar" 
     android:layout_height="fill_parent" 
     android:layout_width="fill_parent"> 
     <Button 
      android:id="@+id/manual_setup" 
      android:text="@string/account_setup_basics_manual_setup_action" 
      android:minWidth="@dimen/button_minWidth" 
      android:layout_height="wrap_content" 
      android:layout_width="wrap_content" 
      android:layout_marginBottom="-4dip" 
      android:layout_alignParentLeft="true" 
      android:layout_centerVertical="false" 
      /> 
     <Button 
      android:id="@+id/next" 
      android:text="@string/next_action" 
      android:minWidth="@dimen/button_minWidth" 
      android:layout_height="wrap_content" 
      android:layout_width="wrap_content" 
      android:drawableRight="@drawable/button_indicator_next" 
      android:layout_marginBottom="-4dip" 
      android:layout_alignParentRight="true" 
      android:layout_centerVertical="false" 
      /> 
    </RelativeLayout>