• Andriod基础-帧布局(FrameLayout)


    帧布局的布局属性

    1. android:layout_gravity="center" 相对于父类样本的位置中间 

    2.android:foregroud = "@mipmap/ic_launcher" 相对于最上面一帧的数据

    3.android:foregroundGravity="center" 最上面一帧数据的位置 

    4.android:gravity="top|left" 内部填充物的位置信息 

    .xml的编写,使用center做为属性的中间

    <?xml version="1.0" encoding="utf-8"?>
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".FrameActivity"
        android:foreground="@mipmap/ic_launcher"
        android:foregroundGravity="center">
    
        <TextView
            android:layout_width="350dp"
            android:layout_height="350dp"
            android:background="#ff0000"
            android:layout_gravity="center"/>
    
        <TextView
            android:layout_width="300dp"
            android:layout_height="300dp"
            android:background="#00ff00"
            android:layout_gravity="center"/>
    
        <TextView
            android:layout_width="250dp"
            android:layout_height="250dp"
            android:background="#00ffff"
            android:layout_gravity="center"/>
    
        <TextView
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:background="#ff00ff"
            android:layout_gravity="center"/>
    
        <TextView
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:background="#ffff00"
            android:layout_gravity="center"
            android:text="黄色文本"
            android:gravity="top|left"/>
    
    </FrameLayout>
    
    
    
  • 相关阅读:
    Oracle开发常用函数与存储过程
    winform 窗体传值
    asp.net中的窗口弹出实现,包括分支窗口 . ASP.NET返回上一页面实现方法总结 .
    android语音识别和合成第三方 .
    百度拾取坐标系统 .
    过滤非法字符和发送邮件
    过滤字符串的Html标记 c#函数 .
    asp.net ListBox 移除操作的思路
    [POI2008]MAF-Mafia
    [BJOI2019]删数
  • 原文地址:https://www.cnblogs.com/my-love-is-python/p/14535238.html
Copyright © 2020-2023  润新知