Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Android编程实现将ButtonBar放在屏幕底部的方法大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

本文实例讲述了Android编程实现将ButtonBar放在屏幕底部方法分享给大家供大家参,具体如下:

前面一篇《Android编程实现将tab选项卡放在屏幕底部的方法》提到ButtonBar的方式写底部button,试了试,看起来外观貌似比Tab好看,不过恐怕没有Tab管理Activity方便吧,毕竟一 个Tab就是一个Activity,但是这样用Button的话,却并不如此,所以这样的涉及可能然好看点,但是管理起来却是相当麻烦。那么暂且把对 activity的管理放在一边,只看界面的设计吧。

要涉及这样的一个buttonbar,主要就是要用到style="@android:style/ButtonBar"这个风格。首先还是来看xml的设计,保存layout/bottombtn.xml

@H_301_6@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://scheR_147_11845@as.android.com/apk/res/android"
  android:orientation="vertical" android:layout_width="fill_parent"
  android:layout_height="fill_parent">
  <TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:id="@+id/textOut"
    android:padding="5px" android:layout_weight="1"/>
  <LinearLayout style="@android:style/ButtonBar"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:orientation="horizontal">
    <Button android:id="@+id/button_weather" android:text="@String/bottom_weather"
      android:layout_width="0dip" android:layout_height="wrap_content"
      android:layout_weight="1"/>
    <Button android:id="@+id/button_mail" android:text="@String/bottom_mail"
      android:layout_width="0dip" android:layout_height="wrap_content"
      android:layout_weight="1"/>
    <Button android:id="@+id/button_Train" android:text="@String/bottom_Train"
      android:layout_width="0dip" android:layout_height="wrap_content"
      android:layout_weight="1"/>
    <Button android:id="@+id/button_sites" android:text="@String/bottom_sites"
      android:layout_width="0dip" android:layout_height="wrap_content"
      android:layout_weight="1"/>
    <Button android:id="@+id/button_stock" android:text="@String/bottom_stock"
      android:layout_width="0dip" android:layout_height="wrap_content"
       android:layout_weight="1"/>
  </LinearLayout>
</LinearLayout>

大佬总结

以上是大佬教程为你收集整理的Android编程实现将ButtonBar放在屏幕底部的方法全部内容,希望文章能够帮你解决Android编程实现将ButtonBar放在屏幕底部的方法所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: