Android編程實現(xiàn)修改標題欄位置使其居中的方法
更新時間:2015年11月13日 12:20:16 作者:ifaithu
這篇文章主要介紹了Android編程實現(xiàn)修改標題欄位置使其居中的方法,涉及Android布局設置的簡單實現(xiàn)技巧,具有一定參考借鑒價值,需要的朋友可以參考下
本文實例講述了Android編程實現(xiàn)修改標題欄位置使其居中的方法。分享給大家供大家參考,具體如下:
package com.example.libraryclient;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.Window;
import com.example.R;
public class HomePageActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//設置布局
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.activity_homepage);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.title);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return super.onCreateOptionsMenu(menu);
}
}
希望本文所述對大家Android程序設計有所幫助。
相關(guān)文章
android采用FFmpeg實現(xiàn)音頻混合與拼接剪切
這篇文章主要為大家詳細介紹了android采用FFmpeg實現(xiàn)音頻混合與拼接剪切,具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-12-12
Android開發(fā)教程之Fragment定義、創(chuàng)建與使用方法詳解【包含Activity通訊,事務執(zhí)行等】
這篇文章主要介紹了Android開發(fā)教程之Fragment定義、創(chuàng)建與使用方法,詳細介紹了Fragment的概念、功能、定義、創(chuàng)建及使用方法,包括Fragment與Activity通訊,Fragment事務執(zhí)行及Fragment應用示例等,需要的朋友可以參考下2017-11-11

