自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Android UI設計模式實例代碼

移動開發(fā) Android
Android UI設計模式實例代碼是本文要介紹的內容,主要是來了解并學習Android UI設計,具體關于Android UI設計內容的詳解來看本文。

Android UI設計模式實例代碼是本文要介紹的內容,主要是來了解并學習Android UI設計,具體關于Android UI設計內容的詳解來看本文。文章Android UI設計內容的實現(xiàn)主要是以代碼來詳解,內容不多。

  1. home.xml  
  2.  
  3. <?xml version="1.0" encoding="utf-8"?> 
  4. <merge 
  5.     xmlns:android="http://schemas.android.com/apk/res/android"> 
  6.     <include 
  7.         layout="@layout/background" /> 
  8.     <LinearLayout 
  9.         android:orientation="vertical" 
  10.         android:layout_width="fill_parent" 
  11.         android:layout_height="fill_parent"> 
  12.         <include 
  13.             layout="@layout/navigator" /> 
  14.         <include 
  15.             layout="@layout/list" 
  16.             android:layout_width="fill_parent" 
  17.             android:layout_height="fill_parent" 
  18.             android:layout_weight="1.0" /> 
  19.         <include 
  20.             layout="@layout/tab" /> 
  21.     </LinearLayout> 
  22. </merge> 
  1. background.xml  
  2.  
  3. <?xml version="1.0" encoding="utf-8"?> 
  4. <ImageView 
  5. xmlns:android="http://schemas.android.com/apk/res/android" 
  6.     android:id="@+id/background" 
  7.     android:layout_width="fill_parent" 
  8.     android:layout_height="fill_parent" 
  9.     android:scaleType="fitXY" 
  10.     android:background="@color/background" /> 
  1. navigator.xml  
  2.  
  3. <?xml version="1.0" encoding="utf-8"?> 
  4. <RelativeLayout 
  5.         android:layout_width="fill_parent" 
  6.         android:layout_height="64dp" 
  7.         android:gravity="center_vertical" 
  8.         style="@android:style/ButtonBar"> 
  9.         <Button 
  10.             android:id="@+id/button_back" 
  11.             android:layout_width="wrap_content" 
  12.             android:layout_height="40dp" 
  13.             android:text="@string/back" /> 
  14.         <Button 
  15.             android:id="@+id/button_home" 
  16.             android:layout_width="wrap_content" 
  17.             android:layout_height="40dp" 
  18.             android:layout_alignParentRight="true" /> 
  19.         <TextView 
  20.             android:id="@android:id/title" 
  21.             android:layout_width="fill_parent" 
  22.             android:layout_height="wrap_content" 
  23.             android:layout_toRightOf="@id/button_back" 
  24.             android:layout_toLeftOf="@id/button_home" 
  25.             android:gravity="center" 
  26.             android:singleLine="true" 
  27.             android:ellipsize="marquee" 
  28.             android:textAppearance="?android:attr/textAppearanceMedium" /> 
  29.     </RelativeLayout> 
  1. list.xml  
  2.  
  3. <?xml version="1.0" encoding="utf-8"?> 
  4. <ListView 
  5.     xmlns:android="http://schemas.android.com/apk/res/android" 
  6.     android:id="@android:id/list" 
  7.     android:layout_width="fill_parent" 
  8.     android:layout_height="fill_parent" 
  9.     android:cacheColorHint="@android:color/transparent" 
  10.     android:drawSelectorOnTop="false" 
  11.     android:listSelector="@drawable/list_selector_background" 
  12.     android:divider="@color/stroke" 
  13.     android:dividerHeight="@dimen/line_width" />  
  1. tab.xml  
  2.  
  3. <?xml version="1.0" encoding="utf-8"?> 
  4. <LinearLayout 
  5.     xmlns:android="http://schemas.android.com/apk/res/android" 
  6.     android:layout_width="fill_parent" 
  7.     android:layout_height="?android:attr/listPreferredItemHeight"> 
  8.     <ImageButton 
  9.         android:id="@+id/tab_profile" 
  10.         android:layout_width="wrap_content" 
  11.         android:layout_height="wrap_content" 
  12.         android:src="@drawable/tab_profile" 
  13.         android:layout_weight="1.0" 
  14.         android:background="@drawable/bg_btn" /> 
  15.     <ImageButton 
  16.         android:id="@+id/tab_friends" 
  17.         android:layout_width="wrap_content" 
  18.         android:layout_height="wrap_content" 
  19.         android:layout_weight="1.0" 
  20.         android:src="@drawable/tab_friends" 
  21.         android:background="@drawable/bg_btn" /> 
  22.     <ImageButton 
  23.         android:id="@+id/tab_games" 
  24.         android:layout_width="wrap_content" 
  25.         android:layout_height="wrap_content" 
  26.         android:layout_weight="1.0" 
  27.         android:src="@drawable/tab_games" 
  28.         android:background="@drawable/bg_btn" /> 
  29. </LinearLayout> 

小結:Android UI設計模式實例代碼的內容介紹完了,希望通過Android UI設計內容的學習能對你有所幫助。

責任編輯:zhaolei 來源: 博客園
相關推薦

2011-06-01 16:12:11

Android UI

2011-05-28 15:14:06

設計技巧UIAndroid

2012-03-01 20:14:25

Android UI

2011-05-28 12:19:33

設計技巧UIAndroid

2010-02-05 14:54:56

Android UI

2013-11-26 16:09:34

Android設計模式

2010-01-21 09:08:53

.NET設計模式

2013-11-26 15:48:53

Android設計模式SDK

2010-02-04 13:30:49

Android UI元

2011-09-07 14:01:41

Android Wid實例

2013-11-26 17:00:08

Android設計模式

2013-11-26 17:15:13

Android設計模式

2013-11-26 16:20:26

Android設計模式

2016-03-28 10:23:11

Android設計單例

2020-11-13 18:59:51

UIAndroidJetBrains

2017-02-17 10:07:02

AndroidMVP模式實例

2011-09-13 16:39:50

Android UI設

2011-05-28 14:25:57

設計技巧UIAndroid

2013-11-26 16:29:22

Android設計模式

2013-11-26 16:39:21

Android設計模式
點贊
收藏

51CTO技術棧公眾號