Android studio知识点

1:在布局中,可以设置layout_below,方便界面布局。在这里插入图片描述
在这里插入图片描述
ps:如果设置的布局中below敲完没有出选项,那就是该布局不支持。

2:fitxy的使用方法,这个用法一般是将图片大小调到铺满屏幕,不留白。比如:
在这里插入图片描述
在这里插入图片描述
3:使用文本框居中的方法:设置layout_gravity=“bottom|center_horizontal”
layoit_Bottom=“35dp”,这样就好了。hravity应用于任何布局,below只能在相关布局中用。在这里插入图片描述
在这里插入图片描述
5.比较几句语句的特点: android:layout_gravity=“center_horizontal”
android:layout_centerVertical=“true” android:layout_centerHorizontal=“true”
6.几个好用的组件:,,,用法很简单,checkbox框框打勾的那种。group和button两个要结合起来用。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:orientation="vertical"
    tools:context=".MainActivity">



    <CheckBox
        android:id="@+ideckBox2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:checked="true"
        android:text="打牌" />

    <CheckBox
        android:id="@+ideckBox3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="溜冰" />

    <CheckBox
        android:id="@+ideckBox4"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="读书" />

    <CheckBox
        android:id="@+ideckBox5"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="旅行" />

    <RadioGroup
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <RadioButton
            android:id="@+id/radioButton2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:checked="true"
            android:text="男" />

        <RadioButton
            android:id="@+id/radioButton3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="女" />

        <RadioGroup
            android:layout_width="match_parent"
            android:layout_height="match_parent" >

            <RadioButton
                android:id="@+id/radioButton4"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:checked="true"
                android:text="晴天" />

            <RadioButton
                android:id="@+id/radioButton5"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="雨天" />

            <Button
                android:id="@+id^tton"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"

                android:text="Button" />

        </RadioGroup>
    </RadioGroup>

</LinearLayout>

运行效果在这里插入图片描述
7:Tablelayout的使用,其实就是一个框框,里面可以自己加东西。table本身就是表格的意思,这个很好理解。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值