[android] 介面的劃分,android介面劃分

來源:互聯網
上載者:User

[android] 介面的劃分,android介面劃分

1.統一介面管理

1.1利用一個activity去管理應用的所有的介面

1.1.1 理解Activity,Window和View之間的關係

1.1.2 避免Activity過多導致的問題,

例如:徹底退出應用,頻繁改動資訊清單檔等

統一介面風格,降低使用者的學習成本

 

2.介面劃分

2.1展示,將介面進行初步劃分

2.2介面管理實現

2.2.1抽取標題管理

2.2.2抽取底部導航管理

2.2.3抽取中間內容部分管理,建立內容部分切換機制

2.2.4完善使用者提示機制

 

2.3 準備工作

2.3.1 匯入圖片和文字等資源檔

可以把項目作為一個libirary庫

 

2.3.2 命名規則說明

防止名稱衝突

2.4 為Activity設定布局檔案

2.4.1 建立三種標題部分布局,兩種導航部分布局

2.4.2 主布局檔案中使用<include/>包含布局檔案

 

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent" >    <!-- 標題部分 -->    <include        android:id="@+id/il_title"        android:layout_width="match_parent"        android:layout_height="20dp"        android:layout_alignParentTop="true"        layout="@layout/il_title" />    <!-- 導航部分 -->    <include        android:id="@+id/il_bottom"        android:layout_width="match_parent"        android:layout_height="20dp"        android:layout_alignParentBottom="true"        layout="@layout/il_bottom" />    <!-- 主體部分 -->    <RelativeLayout         android:layout_below="@id/il_title"        android:layout_above="@id/il_bottom"></RelativeLayout></RelativeLayout>

 

 

 

2.5 螢幕適配

2.5.1 寬度適配

2.5.2 高度適配

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.