您的位置:首页 > 移动开发 > Android开发

简单实现Android顶部工具栏和底部工具栏(原创)

2011-09-23 09:09 666 查看

简单实现Android顶部工具栏和底部工具栏

  

这两个工具栏全是用布局来实现的。底部工具栏布局代码:

  代码

  <?xml version="1.0" encoding="utf-8"?>

<RelativeLayout android:id="@+id/relativeLayout1"
android:background="@color/white" android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:background="@color/white" android:layout_height="wrap_content">

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_weight="1"
android:background="@color/white" android:layout_height="wrap_content">

<LinearLayout android:id="@+id/listLinearLayout"
android:layout_width="fill_parent" android:layout_height="match_parent"
android:orientation="vertical">

<ListView android:id="@+id/list_bendigaoku"
android:cacheColorHint="#00000000" android:paddingLeft="0dp"
android:paddingTop="0dp" android:paddingRight="0dp"
android:paddingBottom="0dp" android:layout_margin="0px"
android:layout_width="fill_parent" android:layout_height="wrap_content" />

<TextView android:layout_height="50dp" android:background="@color/white"
android:layout_width="fill_parent" />

</LinearLayout>

</LinearLayout>
<!-- 最下面的控件-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_alignParentBottom="true" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="40dp">
<!-- 分割线-->
<TextView android:layout_height="1dp" android:background="@color/grey"
android:layout_width="fill_parent" />

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="match_parent">
<Button android:textSize="10dp" android:text="@string/fanhui"
android:layout_weight="1" android:id="@+id/button1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:onClick="click_fanhui" />
<TextView android:layout_height="wrap_content"
android:layout_weight="1" android:layout_width="wrap_content" />

<Button android:textSize="10dp" android:text="未上传"
android:id="@+id/button1" android:layout_weight="1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:onClick="click_weishangchuan" />
<Button android:textSize="10dp" android:text="已上传"
android:id="@+id/button1" android:layout_weight="1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:onClick="click_yishangchuan" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: