zoukankan      html  css  js  c++  java
  • 【Android】1.布局

    LinearLayout

    Linearlayout

    例程效果如下

       <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:weightSum="2">
    
            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:layout_weight="1"
                android:text="button1"
                />
    
            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="right|center_vertical"
                android:text="button2"
                android:visibility="invisible"
                />
            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="button3"
                />
        </LinearLayout>
    

    效果图

    RelativeLayout

    RelativeLayout

    例程效果如下

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:text="进攻"
            />
    
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:text="左勾拳"
            />
    
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_alignParentRight="true"
            android:text="右勾拳"
            />
    
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_alignParentBottom="true"
            android:text="防守"
            />
    
        <Button
            android:id="@+id/btn_juezhao"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerInParent="true"
            android:text="究极带大招"
            />
    
        <!--左上对齐-->
        <Button
            android:id="@+id/btn_zuo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toLeftOf="@id/btn_juezhao"
            android:layout_alignTop="@id/btn_juezhao"
            android:text=""
            />
        <!--上中对齐-->
        <Button
        android:id="@+id/btn_shang"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@id/btn_juezhao"
        android:layout_centerHorizontal="true"
        android:text=""
        />      
        <!--右上对齐-->
        <Button
            android:id="@+id/btn_you"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/btn_juezhao" 
            android:layout_alignTop="@id/btn_juezhao"
            android:text=""
            />
        <!--下中对齐-->
        <Button
            android:id="@+id/btn_xia"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/btn_juezhao"
            android:layout_centerHorizontal="true"
            android:text=""
            />
        
    </RelativeLayout>
    

    在这里插入图片描述

  • 相关阅读:
    使用Netcat实现通信和反弹Shell
    PentesterLab----xss
    nmap实验
    xssgame20关
    使内网服务器访问外网
    lcx端口转发
    提权
    Nmap使用及常见的参数选项
    kali渗透metasploitable靶机
    我待Django如初恋(✪ω✪)的第一天💗
  • 原文地址:https://www.cnblogs.com/SiriusZHT/p/14310808.html
Copyright © 2011-2022 走看看