标签:android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >
    <ImageView
        
        android:id="@+id/image_titilebar"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:background="@drawable/ic_launcher"
        ></ImageView>
    <TextView 
        android:text="选项"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:textSize="20sp"
        android:gravity="center_vertical"
        />
</LinearLayout>
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
public class MainActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		this.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		
		
		
		setContentView(R.layout.activity_main);
		
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
				R.layout.titlebar);
		
		
	}
	
}版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:android
原文地址:http://blog.csdn.net/qq_21063873/article/details/48086029