1
  1. 我要做的就是在我的 android 活动(屏幕)中创建一个简单的页眉和页脚。我RelativeLayout在我的 UI 中使用过。
  2. 而且,如果我想在标题中添加一个弹出菜单,我该怎么做。

请分别回答这两个问题。谢谢

4

2 回答 2

0
For Header You can make an activity_header.xml Class. & it will include in other classes like as-



<include
        android:id="@+id/header"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        layout="@layout/activity_header" />


& for Footer you can use Tab Bar:-
see this:-
http://www.technotalkative.com/android-tab-bar-example-1/
于 2012-10-04T06:49:25.770 回答
0
You can use like as:activity_header.xml Or You can use RelativeLayout  for this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:background="@drawable/header"
    android:orientation="horizontal" >

    <LinearLayout
        android:id="@+id/ll_header"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|bottom"
        android:layout_marginBottom="2dip"
        android:layout_weight="1"
        android:clickable="true"
        android:gravity="center_vertical|center_horizontal"
        android:orientation="vertical" >

        <ImageView
            android:id="@+id/img_header_icon"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            android:src="@drawable/header_logo" />


    </LinearLayout>

</LinearLayout>
于 2012-10-04T07:39:25.173 回答