【发布时间】:2010-01-01 20:49:34
【问题描述】:
我正在寻找有关 Android 默认应用程序(例如电子邮件)或解锁模式中底部栏的视图或某种信息,如下图所示。我无法在 Androids 网站或 Google 搜索中找到任何关于此的信息。
【问题讨论】:
标签: android
我正在寻找有关 Android 默认应用程序(例如电子邮件)或解锁模式中底部栏的视图或某种信息,如下图所示。我无法在 Androids 网站或 Google 搜索中找到任何关于此的信息。
【问题讨论】:
标签: android
我相信克里斯托弗是正确的;没有特殊的小部件可以在图像中创建栏。但是,如果您想模拟它,您可以创建一个布局并使用样式style="@android:style/ButtonBar"。这将为您提供浅灰色背景和正确的边距。
【讨论】:
我认为这些应用程序底部使用的按钮栏没有任何标准视图;通常只是将两个 Button 项目放在一个 LinearLayout 或 RelativeLayout 中。
例如,查看Android Open Source Project,您可以看到button bar for one of the email app setup screens 被定义为两个普通的旧Button 对象。
然而,令人惊讶的是,Google 没有将更多常见的东西抽象到 Android 主题或子布局中,而是在每个布局 XML 中拥有相同的视图和属性。
【讨论】:
<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>
【讨论】: