android位置布局

來源:互聯網
上載者:User

標籤:android   style   color   os   ar   使用   strong   sp   on   

fill_parent

設定一個構件的布局為fill_parent將強制性地使構件擴充,以填充布局單元內儘可能多的空間。這跟Windows控制項的dockstyle屬性大體一致。設定一個頂部布局或控制項為fill_parent將強制性讓它布滿整個螢幕。

 

 wrap_content

設定一個視圖的尺寸為wrap_content將強制性地使視圖擴充以顯示全部內容。以TextView和ImageView控制項為例,設定為wrap_content將完整顯示其內部的文本和映像。布局元素將根據內容更改大小。設定一個視圖的尺寸為wrap_content大體等同於設定Windows控制項的Autosize屬性為True。

match_parent   

Android2.2中match_parent和fill_parent是一個意思 .兩個參數意思一樣,match_parent更貼切,於是從2.2開始兩個詞都可以用。那麼如果考慮低版本的使用方式你就需要用fill_parent了

 

android:gravity 與 android:layout_gravity的區別

android:gravity是指定本元素的子項目相對它的對齊。

android:layout_gravity是指定本元素相對它的父元素的對齊。

android位置布局

聯繫我們

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