Android 创建版面自定义标题
我想创建一个android界面,类似于启动器。为此,我需要在屏幕的每一侧创建一个自定义标题栏和两个边框 我的应用程序中有几个活动,我需要所有活动都包含这些活动,所以我需要创建独立的布局,一个带有自定义标题栏,另一个带有边框。结果可能是: 这是边界的xml:Android 创建版面自定义标题,android,css,android-layout,Android,Css,Android Layout,我想创建一个android界面,类似于启动器。为此,我需要在屏幕的每一侧创建一个自定义标题栏和两个边框 我的应用程序中有几个活动,我需要所有活动都包含这些活动,所以我需要创建独立的布局,一个带有自定义标题栏,另一个带有边框。结果可能是: 这是边界的xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="mat
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<RelativeLayout
android:id="@+id/border_left"
android:layout_width="100dip"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_alignParentLeft="true"
android:background="#000000" >
</RelativeLayout>
<RelativeLayout
android:id="@+id/border_right"
android:layout_width="100dip"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_alignParentRight="true"
android:background="#000000" >
</RelativeLayout>
这是标题的xml:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/title"
android:layout_width="fill_parent"
android:layout_height="26dip"
android:orientation="horizontal"
android:background="#000000" >
问题有二:
-
我怎么才能在标题栏(红场)中间放上一个标志(图像)?
- 如何将这两个布局插入到其他活动中?例如,如何使我的普通主布局包括这两个布局
<include
layout = "@layout/custom_tittlebar" >
</include>
我仍在与标题栏抗争,我想这样放置图像,我在想这是不是最好的方法,或者我必须用photoshop在上面设置徽标来创建一个图像,然后在布局中将其设置为背景。使用sherlock action bar library创建自定义标题栏。我需要的不是一个动作栏,但是一个自定义标题,但我会看一看。谢谢