亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Android layout_weight使用方法及實(shí)例

 更新時(shí)間:2013年06月03日 11:13:27   作者:  
Android layout_weight使用方法及實(shí)例,需要的朋友可以參考一下

直接上代碼和圖片。

情況一:
[html]

復(fù)制代碼 代碼如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <fragment
        android:id="@+id/titles"
        android:layout_width="0dip"
        android:layout_height="match_parent"
        android:layout_weight="1"
        class="com.a2bgeek.fragmentdemo.TitlesFragment" />

    <FrameLayout
        android:id="@+id/details"
        android:layout_width="0dip"
        android:layout_height="match_parent"
        android:layout_weight="2" >
    </FrameLayout>

</LinearLayout>

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <fragment
        android:id="@+id/titles"
        android:layout_width="0dip"
        android:layout_height="match_parent"
        android:layout_weight="1"
        class="com.a2bgeek.fragmentdemo.TitlesFragment" />

    <FrameLayout
        android:id="@+id/details"
        android:layout_width="0dip"
        android:layout_height="match_parent"
        android:layout_weight="2" >
    </FrameLayout>

</LinearLayout>

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <fragment
        android:id="@+id/titles"
        android:layout_width="0dip"
        android:layout_height="match_parent"
        android:layout_weight="1"
        class="com.a2bgeek.fragmentdemo.TitlesFragment" />

    <FrameLayout
        android:id="@+id/details"
        android:layout_width="0dip"
        android:layout_height="match_parent"
        android:layout_weight="2" >
    </FrameLayout>

</LinearLayout>

情況2:

[html]

復(fù)制代碼 代碼如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <fragment
        android:id="@+id/titles"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        class="com.a2bgeek.fragmentdemo.TitlesFragment" />

    <FrameLayout
        android:id="@+id/details"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="2" >
    </FrameLayout>

</LinearLayout>

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <fragment
        android:id="@+id/titles"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        class="com.a2bgeek.fragmentdemo.TitlesFragment" />

    <FrameLayout
        android:id="@+id/details"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="2" >
    </FrameLayout>

</LinearLayout>

情況三:

Fragment這個(gè)東西在wrap_content的情況下會(huì)占據(jù)全部,和控件不太一樣。

相關(guān)文章

  • AndroidStudio3 支持 Java8 了請(qǐng)問你敢用嗎

    AndroidStudio3 支持 Java8 了請(qǐng)問你敢用嗎

    Google 發(fā)布了 AS 3.0,以及一系列的 Support 包,有意思的新東西挺多,AS3里面有一個(gè)亮眼的特性就是支持J8。接下來通過本文給大家分享AndroidStudio3 支持 Java8 的相關(guān)內(nèi)容,感興趣的朋友一起看看吧
    2017-11-11
  • Android?IdleHandler使用方法詳解

    Android?IdleHandler使用方法詳解

    這篇文章主要為大家介紹了Android?IdleHandler使用示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-11-11
  • android使用NotificationListenerService監(jiān)聽通知欄消息

    android使用NotificationListenerService監(jiān)聽通知欄消息

    本篇文章主要介紹了android使用NotificationListenerService監(jiān)聽通知欄消息,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。
    2017-01-01
  • Android動(dòng)態(tài)更新Menu菜單的實(shí)現(xiàn)過程

    Android動(dòng)態(tài)更新Menu菜單的實(shí)現(xiàn)過程

    菜單是用戶界面中最常見的元素之一,使用非常頻繁,下面這篇文章主要給大家介紹了關(guān)于Android動(dòng)態(tài)更新Menu菜單的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2022-09-09
  • Android中使用socket使底層和framework通信的實(shí)現(xiàn)方法

    Android中使用socket使底層和framework通信的實(shí)現(xiàn)方法

    native和framework的通信是通過jni,但是這一般只是framework調(diào)用native,native如果有消息要怎樣通知上層 呢?android中GSP模塊提供一種解決思路,但是實(shí)現(xiàn)有些復(fù)雜,這里介紹一種使用socket通信的方法可以使native和framework自由通信,感興趣的朋友一起看看吧
    2016-11-11
  • Rxjava實(shí)現(xiàn)發(fā)送驗(yàn)證碼倒計(jì)時(shí)功能

    Rxjava實(shí)現(xiàn)發(fā)送驗(yàn)證碼倒計(jì)時(shí)功能

    這篇文章主要為大家詳細(xì)介紹了Rxjava實(shí)現(xiàn)發(fā)送驗(yàn)證碼倒計(jì)時(shí)功能,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-06-06
  • Android常用的intent action匯總

    Android常用的intent action匯總

    這篇文章主要介紹了Android常用的intent action功能與用法,分析了intent的原理以及action屬性常用動(dòng)作名稱、作用與使用方法,需要的朋友可以參考下
    2016-10-10
  • 解決Android橫豎屏切換數(shù)據(jù)丟失問題的方法

    解決Android橫豎屏切換數(shù)據(jù)丟失問題的方法

    這篇文章主要為大家詳細(xì)介紹了Android橫豎屏切換數(shù)據(jù)丟失問題的解決方法,感興趣的小伙伴們可以參考一下
    2016-05-05
  • 詳解Android框架MVVM分析以及使用

    詳解Android框架MVVM分析以及使用

    這篇文章主要介紹了詳解Android框架MVVM分析以及使用,對(duì)MVVM感興趣的同學(xué),一定要看一下
    2021-04-04
  • Android利用控制點(diǎn)的拖拽畫一個(gè)粽子

    Android利用控制點(diǎn)的拖拽畫一個(gè)粽子

    端午節(jié)就要到了,本文我們將利用控制點(diǎn)的拖拽式移動(dòng),動(dòng)態(tài)調(diào)整位置來調(diào)整繪制一個(gè)簡(jiǎn)單的粽子圖形,感興趣的小伙伴可以跟隨小編一起動(dòng)手嘗試一下
    2022-05-05

最新評(píng)論