安卓 將按鈕放置透明佈局文件下

在xml中,標籤從上到下的排列順序,決定了在手機屏幕上的,位於上下層的順序android

 

如:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"xml

      <!--灰色透明的LinearLayout-->layout

      <LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="#55CDCDC1">    tools

      </LinearLayout>標籤

      <Button
              android:layout_width="50dp"
              android:layout_height="50dp" />co

  </RelativeLayout>background

若是這樣寫,按鈕就在灰色透明的LinearLayout上面,

 

若是交換button和LinearLayout的位置,按鈕就在灰色透明的LinearLayout下面

相關文章
相關標籤/搜索