zoukankan      html  css  js  c++  java
  • 2021.2.18 帧布局管理器

    一、今日学习内容

    FrameLayout:帧布局管理器

    1、特点:显示层叠的内容,显示拖动的动画效果

    2、<FrameLayout>标记

    常用属性:

    android:foreground:设置前景图像

    android:foregroundGravity:设置前景图像的位置(前景图像——位于最上层)

    3、实例

    复制代码
     1 <?xml version="1.0" encoding="utf-8"?>
     2 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     3     xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main"
     4     android:layout_width="match_parent" android:layout_height="match_parent"
     5     android:paddingBottom="@dimen/activity_vertical_margin"
     6     android:paddingLeft="@dimen/activity_horizontal_margin"
     7     android:paddingRight="@dimen/activity_horizontal_margin"
     8     android:paddingTop="@dimen/activity_vertical_margin"
     9     android:foreground="@mipmap/mla"
    10     android:foregroundGravity="left|bottom"
    11     tools:context="com.example.action.MainActivity">
    12 
    13     <TextView
    14         android:layout_width="280dp"
    15         android:layout_height="280dp"
    16         android:layout_gravity="center"
    17         android:background="#FF0000FF"
    18         android:text="蓝色背景的TextView"
    19         android:textColor="#FFFFFF"/>
    20     <TextView
    21         android:layout_width="230dp"
    22         android:layout_height="230dp"
    23         android:layout_gravity="center"
    24         android:background="#FF0077FF"
    25         android:text="天蓝色背景的TextView"
    26         android:textColor="#FFFFFF"/>
    27     <TextView
    28         android:layout_width="180dp"
    29         android:layout_height="180dp"
    30         android:layout_gravity="center"
    31         android:background="#FF00B4FF"
    32         android:text="水蓝色背景的TextView"
    33         android:textColor="#FFFFFF"/>
    34 </FrameLayout>
    复制代码

    二、遇到的问题

       没有遇到什么问题

    三、明日计划

       明天学习页面布局

  • 相关阅读:
    Balance的数学思想构造辅助函数
    1663. Smallest String With A Given Numeric Value (M)
    1680. Concatenation of Consecutive Binary Numbers (M)
    1631. Path With Minimum Effort (M)
    1437. Check If All 1's Are at Least Length K Places Away (E)
    1329. Sort the Matrix Diagonally (M)
    1657. Determine if Two Strings Are Close (M)
    1673. Find the Most Competitive Subsequence (M)
    1641. Count Sorted Vowel Strings (M)
    1679. Max Number of K-Sum Pairs (M)
  • 原文地址:https://www.cnblogs.com/wmdww/p/14864733.html
Copyright © 2011-2022 走看看