-
androidStudio开发安卓APP的五种框架布局界面设计
2020-01-18 16:38:29开发安卓app,我们需要美观的界面,然后这些界面,我们必须要掌握的就是对应的框架布局,本次博客,我们将进行app界面的五种框架布局,并给出对应的界面设计的例子 (一)、线性布局框架 1、简单介绍如下: 2、实例...开发安卓APP的五种框架界面设计
开发安卓app,我们需要美观的界面,然后这些界面,我们必须要掌握的就是对应的框架布局,本次博客,我们将进行app界面的五种框架布局,并给出对应的界面设计的例子
(一)、线性布局框架
1、简单介绍如下:
线性布局是Android中较为常用的布局方式,使用LinearLayout标签。线性布局主要有两种形式,一种是水平线性布局,一种是垂直线性布局。需要注意的是Android的线性布局不会换行,当组件一个挨着一个地排列到头之后,剩下的组件将不会被显示出来。
2、实例如下:
计算器的布局
<?xml version="1.0" encoding="utf-8"?> <LinearLayout 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" android:orientation="vertical" android:layout_weight="12" tools:context=".work1"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/work1"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="5" android:text="9.7" android:inputType="none" android:gravity="right" android:background="@drawable/edit_bg"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="3"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:textSize="@dimen/Size" android:text="7"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="@dimen/Size" android:layout_weight="1" android:text="8"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="@dimen/Size" android:layout_weight="1" android:text="9"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="@dimen/Size" android:layout_weight="1" android:text="/"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="3"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:textSize="@dimen/Size" android:text="4"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="@dimen/Size" android:layout_weight="1" android:text="5"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="@dimen/Size" android:layout_weight="1" android:text="6"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="@dimen/Size" android:layout_weight="1" android:text="*"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="3"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="@dimen/Size" android:layout_weight="1" android:text="1"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="@dimen/Size" android:layout_weight="1" android:text="2"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:textSize="@dimen/Size" android:text="3"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:textSize="@dimen/Size" android:text="-"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="3"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:textSize="@dimen/Size" android:text="0"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:textSize="@dimen/Size" android:text="."/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:textSize="@dimen/Size" android:text="+"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:textSize="@dimen/Size" android:text="="/> </LinearLayout> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="CLEAR" android:textSize="@dimen/Size" android:layout_weight="3"/> </LinearLayout>
(二)、框架布局框架
1、简单介绍如下:
2、实例如下:
播放视频的界面设计:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:orientation="vertical" android:layout_weight="12" android:layout_height="match_parent" tools:context=".work2"> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:src="@drawable/view4"/> <ImageView android:layout_width="80dp" android:layout_height="80dp" android:id="@+id/play" android:layout_marginTop="480dp" android:layout_marginLeft="249dp" android:visibility="visible" android:src="@drawable/play"/> </FrameLayout> </LinearLayout>
(三)、表格布局框架
1、简单介绍如下:
有多少个TableRow对象就有多少行,
列数等于最多子控件的TableRow的列数
直接在TableLayout加控件,控件会占据一行
TableLayout属性(也叫全局属性):*代表所有列
android:shrinkColumns -------设置可收缩的列,(内容过多,则收缩,扩展到第二行,控件没布满TableLayout时不起作用)
android:stretchColumns ------设置可伸展的列,(有空白则填充)
列可以同时具备stretchColumns及shrinkColumns属性
android:collapseColumns ------设置要隐藏的列(索引列从0开始)
内部控件属性:
android:layout_column -------该单元格在第几列显示
android:layout_span -------该单元格占据列数,默认为12、实例如下:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:orientation="vertical" android:layout_weight="5" android:layout_height="match_parent" tools:context=".work4"> <TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#FF4081" android:layout_weight="4" android:shrinkColumns="0,1,2"> <Button android:text="我独占一行"/> <TableRow android:layout_weight="1"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:text="0000000000000000" android:textSize="20dp"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:text="1111111111111111" android:textSize="20dp"/> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:text="2222222222222222" android:textSize="20dp"/> </TableRow> <TableRow android:layout_weight="1"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:text="2222222222222222" android:textSize="20dp"/> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_span="2" android:text="我占两列" android:textSize="20dp"/> </TableRow> </TableLayout> <TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ffcd6b" android:shrinkColumns="0,1" android:stretchColumns="0,1"> <TableRow> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="填充一"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="填充二"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="普通三"/> </TableRow> </TableLayout> <TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:shrinkColumns="0,1,2" android:layout_weight="5" android:stretchColumns="0,1,2"> <TableRow> <ImageView android:layout_width="100dp" android:layout_height="100dp" android:src="@drawable/pto5"/> <ImageView android:layout_width="100dp" android:layout_height="100dp" android:src="@drawable/pto6"/> <ImageView android:layout_width="100dp" android:layout_height="100dp" android:src="@drawable/pto7"/> </TableRow> </TableLayout> </LinearLayout>
(四)、绝对布局框架
1、简单介绍如下:
AbsoluteLayout(绝对布局)
又可以叫做坐标布局,可以直接指定子元素的绝对位置(xy)
由于手机屏幕尺寸差别比较大
使用绝对定位的适应性会比较差,在屏幕的适配上有缺陷
AbsoluteLayout子类控件的属性
android:layout_x=”35dip” 控制当前子类控件的x位置
android:layout_y=”40dip” 控制当前子类控件的y位置2、实例如下:
<?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" 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:layout_x="236dp" android:layout_y="94dp" android:text="Button" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="143dp" android:layout_y="166dp" android:text="Button" /> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="33dp" android:layout_y="263dp" android:text="Button" /> </AbsoluteLayout>
(五)、相对布局框架
1、简单介绍如下:
2、实例如下:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:orientation="vertical" android:layout_weight="12" android:layout_height="wrap_content" tools:context=".work3"> <RelativeLayout android:layout_width="match_parent" android:layout_weight="8" android:layout_height="wrap_content"> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/back" android:src="@drawable/pto4" /> <ImageView android:layout_width="130dp" android:layout_height="130dp" android:id="@+id/pto" android:layout_marginTop="70dp" android:layout_marginLeft="5dp" android:src="@drawable/pto"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/edit" android:layout_marginTop="70dp" android:hint="@string/work31" android:layout_marginLeft="5dp" android:layout_toRightOf="@id/pto"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/edit1" android:hint="@string/work32" android:inputType="textPassword" android:layout_marginTop="120dp" android:layout_marginLeft="5dp" android:layout_toRightOf="@id/pto"/> <CheckBox android:layout_width="90dp" android:layout_height="wrap_content" android:id="@+id/left" android:layout_toRightOf="@id/pto" android:layout_marginLeft="5dp" android:text="记住密码" android:layout_below="@+id/edit1"/> <CheckBox android:layout_width="90dp" android:layout_height="wrap_content" android:layout_below="@+id/edit1" android:id="@+id/right1" android:layout_toRightOf="@+id/left" android:text="自动登录" /> </RelativeLayout> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="登录"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width="match_parent" android:layout_weight="1" android:layout_height="wrap_content" android:textColor="#FF4081" android:text="忘记密码?"/> <TextView android:layout_width="match_parent" android:layout_weight="1" android:layout_height="wrap_content" android:textColor="#FF4081" android:gravity="right" android:text="注册账号"/> </LinearLayout> </LinearLayout>
本次博客的页面布局框架就讲解到这里哦,感谢大家查看,记得点赞留言评论哦!
-
安卓第二章 常见的五种布局
2016-01-21 14:27:08安卓第二章 常见的四种布局 1.线性布局LinearLayout 分为水平线性布局和垂直线性布局都是在水平或者垂直方向单一排列 android:layout_width 宽度 android:layout_height 高度 属性值:fill_parent(不推荐...安卓第二章 常见的四种布局
1.线性布局LinearLayout
分为水平线性布局和垂直线性布局都是在水平或者垂直方向单一排列
android:layout_width 宽度
android:layout_height 高度
属性值:fill_parent(不推荐使用了) ,match_parent (匹配父容器),
wrap_content(包围内容),自定义尺寸(具体的值)
android:background 背景色
RGB &ARGB 颜色以及加了透明度的颜色
对齐方式:
android:gravity 内部对齐(容器内全部子控件遵循该对齐方式)(水平居中,垂直居中,正居中)
android:layout_gravity 外部对齐(针对某一个单独的子控件进行对齐,其他兄弟控件不收影响)
android:orientation 对齐的方向 horizontal(默认,水平方向),vertical 垂直方向
android:layout_weight 权重(可以将其比喻成体重,代表子控件在某一个方向上所占的比重,注意:当使用该属性的时候,对应的宽高需要设置为 0dp)。
2.相对布局RelativeLayout
可以相对父容器/兄弟控件位置任意摆放,布局灵活
android:layout_alignParentBootom: 相对于父容器的底部 属性值:true/false
android:layout_alignParentTop: 的顶部 ………….
android:layout_alignParentLeft: 左边 ……..
android:yout_alignParentRight 右边 ……..
android:layout_centerhorization 在父容器内水平居中
android:layout_centerInParent 在父容器内垂直居中
android:layout_toLeftOf 在兄弟控件的左边
android:layout_toRightOf ..右边
android:layout_above ..上方
android:layout_below ..下方
anroid:layout_alignLeft 自己的左边与兄弟控件的左边对齐
android:layout_alignRight 自己的右边与兄弟控件的右边对齐
android:layout_alignTop 自己的顶部与兄弟控件的顶部对齐
android:layout_alignBottom 自己的底与兄弟控件的底部对齐
android:layout_alignBaseLine 文本视图,对齐文本的基准线
android:layout_marginLeft 左侧外边距(子控件使用,其他兄弟控件不受影响)
android:layout_marginRight 右侧..
android:layout_marginTop 顶部..
android:layout_marginBottom 底部..
android:layout_margin 四周..
android:paddingLeft 左侧内边距(容器使用,容器内全部子控件均受到影响。该属性同样可以适用于TextView等控件,使控件和控件内的内容有内间距)
android:paddingRight 右侧..
android:paddingTop 顶部..
android:paddingBottom 底部..
android:padding 四周
3.帧布局FrameLayout
子控件重叠摆放
android:foreground 前景色
4. 网格布局GridLayout
诞生自Android4.0系统,特点:子控件不需要宽/高属性
android:rowCount 行数
android:columnCount 列数
android:layout_columnSpan 子控件占据列数
android:layout_rowSpan 子控件占据行数
-
安卓五大布局
2018-09-25 19:05:33android的布局方式有五种,分别是:LinearLayout(线性布局)、FrameLayout(单帧布局)、RelativeLayout(相对布局)、AbsoluteLayout(绝对布局)和TableLayout(表格布局)。布局之间是可以相互嵌套的。 1.***...android的布局方式有五种,分别是:LinearLayout(线性布局)、FrameLayout(单帧布局)、RelativeLayout(相对布局)、AbsoluteLayout(绝对布局)和TableLayout(表格布局)。布局之间是可以相互嵌套的。
1.***LinearLayout(线性布局)***: 这种布局比较常用,也比较简单,就是每个元素占一行,当然也可能声明为横向排放,也就是每个元素占一列。
<?xml version="1.0" encoding="utf-8"?><LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#ff000000" android:text="@string/hello"/> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#ff654321" android:layout_weight="1" android:text="1"/> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#fffedcba" android:layout_weight="2" android:text="2"/> </LinearLayout>
2.***FrameLayout(单帧布局)***: FrameLayout是五大布局中最简单的一个布局,可以说成是层布局方式。在这个布局中,整个界面被当成一块空白备用区域,所有的子元素都不能被指定放置的位置,它们统统放于这块区域的左上角,并且后面的子元素直接覆盖在前面的子元素之上,将前面的子元素部分和全部遮挡。
<?xml version="1.0" encoding="utf-8"?>3.***RelativeLayout(相对布局)***: RelativeLayout按照各子元素之间的位置关系完成布局。在此布局中的子元素里与位置相关的属性将生效。例如android:layout_below, android:layout_above, android:layout_centerVertical等。注意在指定位置关系时,引用的ID必须在引用之前,先被定义,否则将出现异常。
<?xml version="1.0" encoding="utf-8"?>RelativeLayout是Android五大布局结构中最灵活的一种布局结构,比较适合一些复杂界面的布局。
4.***AbsoluteLayout(绝对布局)***: 在此布局中的子元素的android:layout_x和android:layout_y属性将生效,用于描述该子元素的坐标位置。屏幕左上角为坐标原点(0,0),第一个0代表横坐标,向右移动此值增大,第二个0代表纵坐标,向下移动,此值增大。在此布局中的子元素可以相互重叠。在实际开发中,通常不采用此布局格式,因为它的界面代码过于刚性,以至于有可能不能很好的适配各种终端。
<?xml version="1.0" encoding="utf-8"?>5.***TableLayout(表格布局)***: 适用于N行N列的布局格式。一个TableLayout由许多TableRow组成,一个TableRow就代表TableLayout中的一行。
<?xml version="1.0" encoding="utf-8"?>TableRow是LinearLayout的子类,ablelLayout并不需要明确地声明包含多少行、多少列,而是通过TableRow,以及其他组件来控制表格的行数和列数, TableRow也是容器,因此可以向TableRow里面添加其他组件,没添加一个组件该表格就增加一列。如果想TableLayout里面添加组件,那么该组件就直接占用一行。在表格布局中,列的宽度由该列中最宽的单元格决定,整个表格布局的宽度取决于父容器的宽度(默认是占满父容器本身)。
-
安卓布局
2014-08-05 11:56:59安卓里面的布局方式主要有以下五种:LinearLayout、FrameLayout、RelativeLayout、AbsoluteLayout、TableLayout。...下面简单介绍一下这五种布局。 1、 LinearLayout :线性布局,按水平或垂直...安卓里面的布局方式主要有以下五种:LinearLayout、FrameLayout、RelativeLayout、AbsoluteLayout、TableLayout。一个简单的界面可以不使用多种布局,但是如果界面稍微复杂或者想要界面布局更加舒服好看很多时候是要多种布局嵌套使用的。下面简单介绍一下这五种布局。
1、 LinearLayout :线性布局,按水平或垂直来排列所有的元素,即N行或者N列,不论元素的宽度或高度是多少。如果想要多行多列,只要在LinearLayout里面嵌套LinearLayout布局就好了。android:layout_weight 是线性布局里的一个属性,用来描述该布局里的子元素所占的比重大小,按比值分配,且数值越小所占的比重越高,如果只有一个元素则默认为0。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="btn01 :..."> </Button> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="btn02:..."> </Button> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="btn03:..."> </Button> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="btn04:..."> </Button> </LinearLayout> </LinearLayout>
2、FrameLayout:单帧布局。在这个布局中所有的组件都在该视图的左上角而无法指定位置。最后的效果就是后面的被前面的覆盖。
<FrameLayout 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:layout_width="wrap_content" android:layout_height="wrap_content" android:text="btn00000000000"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="btn1111"/> </FrameLayout>
3、RelativeLayout:相对布局,最常用的布局。因为这种布局是把组件之间相互联系起来布局的,每个组件的位置都是依赖其他组件存在的。所以在这种布局里要用到最重要的就是组件的id。
在这种布局里如果要改动某个组件的id,那就在所有与它有关的组件里都要改,否则会报错。那么组件之间怎么联系呢?很简单,无非就是左对齐右对齐顶端对齐之类,使用起来并不难。
<RelativeLayout 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" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".RelativeActivity" > <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:text="Button" /> <Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/button1" android:layout_toRightOf="@+id/button1" android:text="Button" /> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/button1" android:layout_below="@+id/button1" android:text="Button" /> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignRight="@+id/button2" android:layout_below="@+id/button3" android:text="TextView" /> </RelativeLayout>
4、AbsoluteLayout:绝对布局。如名字所说这种布局确实很绝对,里面的每个组件都要求有这样两个属性,android:layout_x和android:layout_y,用来描述组件的位置。这种布局并不好用,因为一款APP如果换了终端换了屏幕大小原来的布局就显得不合适了。
<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" tools:context=".AbsoluteActivity" > <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="49dp" android:layout_y="137dp" android:text="Button" /> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="194dp" android:layout_y="227dp" android:text="TextView" /> </AbsoluteLayout>
5、TableLayout:表格布局。把整个界面分成表格一样的形式,每个组件占有相同的空间。TableLayout中包含许多的TableRow,TableRow就相当于表格中的一行。如果不把组件放进TableRow中,那么就会占满整行。
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".TableActivity" > <TableRow> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> </TableRow> <TableRow> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> </TableRow> </TableLayout>
-
安卓基础知识回顾------Android中的五大布局
2018-06-04 14:51:45在android中的布局有五大类,这五种布局为别为:LinearLayout(线性布局),FrameLayout(框架布局),RelativeLayout(相对布局),TableLayout(表格布局),AbsoluteLayout(坐标布局) 我们目前的学习中主要运用... -
安卓-屏幕适配的五种方式
2016-04-07 09:19:36适配方式一图片适配适配方式二dimensxml文件适配适配方式三布局文件适配适配方式四java代码适配适配方式五权重适配 转自http://www.bkjia.com/Androidjc/963563.html#comment 适配:即当前应用在相同的 -
安卓学习笔记04--五大布局
2015-04-11 10:58:24一、布局(五大布局) 1、线性布局 linearlayout 特点:呈线性排列(水平,垂直)。 属性: (1)orientation排列方式属性有两种vetical,horzontial (2)Layout_gravity指定组件在父组件中的位置... -
安卓5大布局
2014-10-29 16:35:08为了适应各式各样的界面风格,Android系统提供了5种布局,这5种布局分别是: LinearLayout(线性布局) ...利用这五种布局,可以在屏幕上将控件随心所欲的摆放,而且控件的大小和位置会随着屏幕大小的变 -
Android的五大布局
2015-02-11 14:09:08上篇文章我讲了Android的一些基本组件,今天我就来讲讲安卓的布局。因为在上次贴的xml代码里面我们就至少...首先,安卓有五种布局,LinearLayout(线性布局)、RelativeLayout(相对布局)、FrameLayout(帧布局)、... -
Android安卓布局简介
2014-08-02 20:34:42安卓的五大布局方式有 1. 线性布局(LinearLayout):用的比较多,也比较实用,这里面有垂直和横向布局方式 这就是线性布局的两种方式,当用线性布局的时候,LinearLayout中的子元素属性android:layout_weight... -
安卓基础篇《Android 五大布局基本使用》
2018-12-04 15:23:02在开始讲解5大布局前,我们先看下一种被Android studio默认的新型布局: ConstraintLayout 约束布局: 概念:ConstraintLayout约束布局的含义: 根据布局中的其他元素或视图, 确定View在屏幕中的... -
安卓基础:Activity基础、五大布局
2015-08-19 20:45:47它是一种可以包含用户界面的组件,主要用于和用户进行交互。Activity是有生命周期的,每个Activity在其生命周期中最多可能会有四种状态: Activity的生命周期: Activity有七个回调方法,覆盖了Activity生命... -
【安卓小笔记】android的页面布局
2016-05-13 23:34:06一共有五种页面布局: 1.LinearLayout 线性布局 2.RelativeLayout 相对布局 3.FreameLayout 帧布局(框架布局) 4.AbsoluteLayout 绝对布局 5.TableLayout 表格布局 --------LinearLayout线性... -
Day2-Android studio五大布局
2018-06-06 20:41:03安卓五大布局安卓五大布局分别是 线性布局 相对布局 绝对布局 表格布局 帧布局1.LinearLayout 线性布局: 属性1:水平或者垂直排列 属性2:子视图不可能重叠线性布局有一个特有的方法oritation来设置它的方向... -
安卓代码、图片、布局、网络和电量优化
2018-08-16 06:11:43写在前面的话,前段时间写了一篇文章 二十三种设计模式,写的不详细,因为如果要写的很详细,估计一年半载都写不完,完全都是按照自己理解,每个设计模式就画了一个简单的图,同时完成了一个小Demo,哪知道这篇文章... -
android 控件上下排列_Android几种常用布局详解
2021-01-26 14:50:44原来安卓有五大基本布局,现在共有六种,前五种是传统的,还有一种是比较新的。五种传统布局LinearLayout(线性布局)RelativeLayout(相对布局)FrameLayout(帧布局)AbsoluteLayout(绝对布局)TableLayout(表格布局)... -
Android 五种常用的对话框
2020-11-18 10:14:55Android 五种常用的对话框 第一步:安卓界面布局 添加5个按钮,点击可显示不同的对话框效果 布局代码: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=... -
Android开发五大布局及其属性整合
2012-12-12 11:56:40经过一天的学习,我了解到在安卓开发中我们常用的布局方式有这么几种: 1.LinearLayout ( 线性布局 ) :(里面只可以有一个控件,并且不能设计这个控件的位置,控件会放到左上角) 线性布局分为水平线性和垂直... -
Android学习笔记——五大基本布局+AbsoluteLayout
2015-12-02 15:09:25安卓中一共有6种基本布局,分别是LinearLayout(线性布局)、RelativeLayout(相对布局)、AbsoluteLayout(绝对布局)、FrameLayout(帧布局)、TableLayout(表格布局)和GridLayout(网格布局)。其中,... -
安卓屏幕适配的问题
2019-01-26 10:27:04屏幕适配的问题 首先一般都不需要适配: 良好的屏幕适配习惯: 多用dp,不用px, 多用线性...如还有问题就用哪五种 图片适配 hdpi -> 480800 设备密度1.5 mdpi -> 320480 设备密度1 ldpi -> 3... -
安卓面试宝典
2019-01-22 11:16:00本篇文章主要内容为笔者面试安卓岗位面试常问问题,如果要面试安卓相关岗位的...线性布局分为两种:水平方向和垂直方向的布局。 TableLayout 表格布局 表格布局,适用于多行多列的布局格式,每个TableLayout是由多... -
Android布局方式的主要特征
2015-04-15 19:13:52在安卓系统中的布局方式有五种,最常用的是相对布局和线形布局,同时各个布局之间是可以嵌套使用的。下面分别来介绍他们的主要特征. 线形布局LinearLayout: 子控件以水平或者垂直方式排列. 里面有几个属性需要... -
Android 开发(二)布局管理器
2020-03-10 11:36:46文章目录1. 线性布局管理器1.1 定义1.2 实现方式2. 表格布局管理器2.1 定义2.2 实现...对以下五种布局管理器,分别提供了对应的五种布局方式(线性布局、表格布局、帧布局、相对布局、绝对布局) 1. 线性布局管理器... -
安卓基础学习之------思维方式
2016-08-14 22:54:00根据这个可以做一个电话拨号器,用意图(Intent)对象(后面讲)来调用另外的活动来实现打电话的功能,然后,就是要学会简单的布局,安卓中的布局有五种,在上一篇博文笔记里有写,算了,还是说一下吧,线性布局,相对...
-
【Python-随到随学】 FLask第一周
-
虚幻4引擎基础
-
MySQL NDB Cluster 负载均衡和高可用集群
-
process-power:一个用于网站processpower.surge.sh的存储库-源码
-
2021 年该学的 CSS 框架 Tailwind CSS 实战视频
-
travizzle.github.io:学习足够CSS和布局危险的示例网站-源码
-
React登陆页面-源码
-
linux基础入门和项目实战部署系列课程
-
Mycat 实现 MySQL的分库分表、读写分离、主从切换
-
github-action-pr-helper:GitHub Actions的PullRequest帮助器-源码
-
iOS开发中自旋和互斥锁的理解以及所有锁的性能比较
-
竞争性编程-源码
-
基于电商业务的全链路数据中台落地方案(全渠道、全环节、全流程)
-
ucsb-cs64-lab03-源码
-
游戏商店-源码
-
仅用CSS创建立体旋转幻灯片
-
Angular-厨房水槽:Angular-通过示例学习-源码
-
智能停车场云平台(附vue+SpringBoot前后端项目源码)
-
全景照片不怕歪!Facebook 用神经网络矫正扭曲的地平线
-
POJ3187题解(DFS全排列)