成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

Android ApiDemo示例解讀5:Activity->Custom Title

移動開發(fā) Android
Android允許Activity自定義標(biāo)題欄,使用自定義Layout重新設(shè)置標(biāo)題欄,App->Activity->Custom Title 重新將Activity標(biāo)題欄定義為左右兩個文本框。

Android UI缺省的標(biāo)題欄由android:label 定義,顯示在屏幕左上角,Android允許Activity自定義標(biāo)題欄,使用自定義Layout重新設(shè)置標(biāo)題欄,比如實現(xiàn)Windows Mobile 風(fēng)格的標(biāo)題欄。

App->Activity->Custom Title 重新將Activity標(biāo)題欄定義為左右兩個文本框,其Layout定義R.layout.custom_title_1如下:

(下面的xml中包含了一左一右兩個文本框。

與每個Activity對應(yīng)的除了使用由setContentView設(shè)置的Content View之外,還有一個Windows類對象,Windows 類對象用于控制標(biāo)題欄,可以允許自定義標(biāo)題欄或是不顯示標(biāo)題欄。)

  1. <RelativeLayout   
  2.  xmlns:android=”http://schemas.android.com/apk/res/android”   
  3.  android:id=”@+id/screen”   
  4.  android:layout_width=”match_parent”   
  5.  android:layout_height=”match_parent”   
  6.  android:orientation=”vertical”>   
  7.  <TextView android:id=”@+id/left_text”   
  8.  android:layout_width=”wrap_content”   
  9.  android:layout_height=”wrap_content”   
  10.  android:layout_alignParentLeft=”true”   
  11.  android:text=”@string/custom_title_left” />   
  12.  <TextView android:id=”@+id/right_text”   
  13.  android:layout_width=”wrap_content”   
  14.  android:layout_height=”wrap_content”   
  15.  android:layout_alignParentRight=”true”   
  16.  android:text=”@string/custom_title_right” />   
  17.  </RelativeLayout>   

Windows 定義了一些Feature,允許開發(fā)人員做些定制:自定義標(biāo)題欄對應(yīng)的Feature ID為Window.FEATURE_CUSTOM_TITLE。

  1. requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);   
  2. setContentView(R.layout.custom_title);   
  3. getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title_1);   

Android ApiDemo示例解讀系列之五:App->Activity->Custom Title

 

責(zé)任編輯:閆佳明 來源: jizhuomi
相關(guān)推薦

2013-12-19 14:13:16

Android ApiAndroid開發(fā)Android SDK

2013-12-19 14:32:31

Android ApiAndroid開發(fā)Android SDK

2013-12-19 14:34:52

Android ApiAndroid開發(fā)Android SDK

2013-12-19 14:36:43

Android ApiAndroid開發(fā)Android SDK

2013-12-19 14:00:39

Android ApiAndroid開發(fā)Android SDK

2013-12-19 14:28:04

Android ApiAndroid開發(fā)Android SDK

2013-12-19 13:40:44

Android ApiAndroid開發(fā)Android SDK

2013-12-19 13:51:12

Android ApiAndroid開發(fā)Android SDK

2013-12-19 16:26:29

Android ApiAndroid開發(fā)Android SDK

2010-02-02 14:22:50

Python示例

2010-02-01 11:22:09

C++虛函數(shù)

2014-05-27 14:33:37

AndroidActivitysingleTask

2010-03-02 14:41:00

WCF行為控制

2010-03-05 10:47:05

Python futu

2010-02-04 16:07:39

C++回調(diào)函數(shù)

2010-01-04 17:03:27

Silverlight

2015-10-20 15:54:16

android源碼滑動關(guān)閉

2012-02-17 17:07:30

Android安全Activity劫持

2013-01-08 13:33:07

Android開發(fā)Activity入門指南

2010-01-08 10:48:05

VB.NET多線程
點贊
收藏

51CTO技術(shù)棧公眾號

主站蜘蛛池模板: 精品一二三区视频 | 四虎影院新网址 | 国产视频二区 | 欧美精品久久久久久久久久 | 欧美在线a | 亚洲欧美在线视频 | 日韩av一区二区在线观看 | 国产乱码精品一区二区三区五月婷 | 日韩视频中文字幕 | 日韩精品在线网站 | 精品视频一区二区三区在线观看 | 午夜三区 | 成人免费看| 国产一区精品 | 中文字幕一区二区三区精彩视频 | 精品成人一区 | 特黄特黄a级毛片免费专区 av网站免费在线观看 | 成人午夜电影在线观看 | 毛片一区二区三区 | 午夜资源 | 国产精品欧美一区二区三区不卡 | 日韩一区二区在线观看视频 | 国产99久久精品一区二区永久免费 | 午夜视频在线观看视频 | 日本一级淫片免费啪啪3 | 观看av | 99色视频| 亚洲91精品 | 中文在线一区二区 | 91av亚洲| 日本一区二区三区四区 | 欧美一级久久 | 91精品国产乱码久久久久久久久 | 成年人免费在线视频 | 久久日韩粉嫩一区二区三区 | 国产在线精品免费 | 欧美日一区 | 久久国内| 中文字幕亚洲精品 | 91精品国产综合久久精品 | 国产羞羞视频在线观看 |