Android:控件布局(單幀布局)FrameLayout


FrameLayout:所有控件位於左上角,並且直接覆蓋前面的子元素。

在最上方顯示的層加上: android:clickable="true" 可以避免點擊上層觸發底層。

實例:

 

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

    <TextView
         android:layout_gravity="center"
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="80%" />

    <ProgressBar
        android:layout_gravity="center"
        android:id="@+id/progressBar1"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="160dp"
        android:layout_height="160dp" />

</FrameLayout>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM