Android UI开发

在这里插入图片描述
线性布局(LINEARLLAYOUT)
在这里插入图片描述

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="match_parent">
<Button android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="按钮1"
    android:textSize="20sp"
    />
    <Button android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="按钮2"
        android:textSize="20sp"
        />
    <Button android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="按钮3"
        android:textSize="20sp"
        />
</LinearLayout>

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:orientation="horizontal"
    android:layout_height="match_parent">
    <Button android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="按钮1"
        android:textSize="20sp"
        />
    <Button android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="按钮2"
        android:layout_weight="1"
        android:textSize="20sp"
        />
    <Button android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="按钮3"
        android:layout_weight="1"
        android:textSize="20sp"
        />
</LinearLayout>

1、 
Android UI开发中,设置线性布局为垂直显示需修改的属性的()

Aandroid:orientation="vertical"
Bandroid:orientation="horizontal"
Candroid:layout_centerHorizontal="true"
Dandroid:layout_centerVertical="true"
您提交答案:A

正确答案:A

2、 
在下列选项中,设置线性布局方向的属性是()

A、orientation
B、gravity
C、layout_gravity
D、padding
您提交答案:A

正确答案:A

3、 
在线性布局中,当控件水平排列时,控件属性layout_width设置为()

A、wrap_content
B、match_parent
C、fill_parent
D、以上都可以
您提交答案:D

正确答案:A

相对布局

默认相对布局左上角

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:paddingBottom="20dp"
    android:layout_height="match_parent">
<Button
    android:id="@+id/btn_one"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="20sp"
    android:text="按钮1"
    android:layout_alignParentBottom="true"
    />
    <Button
        android:id="@+id/btn_two"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="20sp"
        android:text="按钮2"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="260dp"
        />
    <Button
        android:id="@+id/btn_three"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="20sp"
        android:text="按钮3"
        android:layout_toRightOf="@id/btn_two"
        android:layout_alignBottom="@id/btn_two"
        android:layout_marginBottom="100dp"
        />
</RelativeLayout>

在这里插入图片描述
在这里插入图片描述

1、 
在相对布局文件中,把控件与另外一个控件的下边使用的属性是()

A、layout_above
B、padding
C、layout_below
D、layout_margin
您提交答案:C

正确答案:C

2、 
在相对布局文件中,把控件显示在另外一个控件的右侧使用的属性是()

A、layout_toRightOf
B、layout_toLeftOf
C、layout_toStartOf
D、layout_toEndOf
您提交答案:A

正确答案:A

3、 
Android相对布局中,使控件相对父控件底部对齐使用的属性是()。

Aandroid:layout_alignParentBottom
Bandroid:layout_alignBottom
Candroid:layout_alignBaseline
Dandroid:layout_alignParentTop
您提交答案:A

正确答案:A

帧布局(Framelayout)

在这里插入图片描述
在这里插入图片描述

1、 
在Android UI开发中,常见的刮刮卡是通过()实现的。

A、FrameLayout
B、LinearLayout
C、RelativeLayout
D、TableLayout
您提交答案:A

正确答案:A

2、 
Android UI开发中,帧布局中的子控件都是()对齐的。

A、右上角
B、左上角
C、左下角
D、右下角
您提交答案:B

正确答案:B

3、 
Android UI开发中,常见的刮刮卡是通过()实现的。

A、帧布局
B、线性布局
C、相对布局
D、没有答案
您提交答案:A

正确答案:A

表格布局(Tablelayout)

在这里插入图片描述

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="111"
            />

    </TableRow>
    <TableRow>
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="111"
            />
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="111"
            />
    </TableRow>
</TableLayout>

在这里插入图片描述
在这里插入图片描述
绝对布局absolutelayout
在这里插入图片描述

<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout 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">

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button"
        tools:layout_editor_absoluteX="103dp"
        tools:layout_editor_absoluteY="52dp" />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button"
        tools:layout_editor_absoluteX="142dp"
        tools:layout_editor_absoluteY="192dp" />
</AbsoluteLayout>

在这里插入图片描述

常见控件

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

radio button
在这里插入图片描述

在这里插入图片描述
监听
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

理想不闪火

你的鼓励将是我最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值