Android學習系列(5)--App布局初探之簡單模型

來源:互聯網
上載者:User

人類科技的進步源自探索,探索來自於發現本原,當然App布局沒這麼先進,本文也只是一個歸類總結。
這篇文章是android開發人員的必備知識,是我特別為大家整理和總結的,不求完美,但是有用。

Android介面開發多多少少會有很多雷同或者相似的布局,不僅如此,縱觀Android應用的介面,總也逃不出那些熟悉的結構。
今天,我根據經驗,把我認為的常見的布局做一個分析,歸納出幾種簡單的模型,這些模型一般是我認為解決其對應布局問題的最佳布局,具體要看情況。
因為工作的限制,我無法專門研究天馬行空,萬羅天象的布局,只能根據我工作中碰到的布局,略加斟酌。
還有一點我要強調,這些布局的原則就是:簡單,靈活。 

模型一: 水平三列坐擁式
      :
      
      說明:水平三列,兩邊分別是"返回","提交"的按鈕,中間是必須置中的幾個字,一般都是標題名稱。
              彷彿標題內容的背景坐擁左右兩位美女般的按鈕。
      方法:主要使用FrameLayout布局
      素材:
              、
      layout代碼:

html#viewSource" commandName="viewSource" highlighterId="highlighter_174070">view sourceprint?
01 <!--這種布局:
02 缺點是,標題只能就幾個字,字多了就會撐開並和兩邊的按鈕重疊
03 優點是,代碼簡潔;-->
04 <?xml version="1.0" encoding="utf-8"?>
05 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
06     android:layout_width="fill_parent"
07     android:layout_height="wrap_content"
08     android:background="@drawable/layout01_bg"
09     android:paddingLeft="10dip"
10     android:paddingRight="10dip"
11     >
12     <Button android:layout_gravity="left|center_vertical"
13         android:layout_width="wrap_content"
14         android:layout_height="wrap_content"
15         android:background="@drawable/layout01_tool"

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.