- 浏览: 229584 次
- 性别:
- 来自: 广州
-
文章分类
- 全部博客 (109)
- IOS (15)
- 设计模式 (7)
- XML (1)
- Android (31)
- 面试经 (1)
- J2EE (3)
- android md5 加密 (2)
- android imagebutton文字实现 (1)
- 反射机制 (2)
- 基础知识 (1)
- linux (3)
- java (4)
- java基础 (2)
- 文章 (1)
- myeclipse tomcat (1)
- Hadoop (1)
- ubuntu (2)
- redmine (1)
- python (4)
- jmeter (10)
- xamarin (1)
- selenium (9)
- nexus (1)
- appium (3)
- BDD (1)
- apache2 (1)
- zabbix (2)
- python,webdriver (1)
- ajax (1)
- jmeter,正则表达式,关联 (2)
- 性能测试工具 (1)
- Django (0)
- Intelij (1)
- RAP (0)
- 性能测试 (0)
最新评论
对于android系统布局方式有以下几种:
1、LinearLayout -线性布局
是页面中的所有组建都是按照线性布局,
纵向:
android:orientation="vertical" 表示组建垂直排成一列;
横向水平:
android:orientation="horizontal"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
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:text="@string/mobile"
android:id="@+id/mobilelable"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/mobilenumer"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/smslable"
android:id="@+id/smslable"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minLines="3"
android:id="@+id/messages"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/send_button"
android:id="@+id/sms_button"
/>
</LinearLayout>
2、AbsoluteLayout - 绝对布局
该布局方式:
1)给每个组建都要定义id,如一个组建:android:id="@+id/linearlayout"
2)例如另一个组建要位于该组建的下方则在组建中:android:layout_below="@id/linearlayout"
3)位于父控件的右侧:android:layout_alignParentRight="true"
还有其他的一些用法,如:位于父控件的左侧等等。
其实android布局方式就和Html中table布局类似,也可以布局嵌套,标签嵌套。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/linearlayout"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="@string/mobile"
android:id="@+id/mobilelable"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/mobilelable"
android:id="@+id/mobilenumer"
/>
</LinearLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/linearlayout"
android:textSize="18sp"
android:text="@string/smslable"
android:id="@+id/smslable"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/smslable"
android:minLines="3"
android:id="@+id/messages"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/messages"
android:layout_alignParentRight="true"
android:text="@string/send_button"
android:id="@+id/sms_button"
/>
</RelativeLayout>
3、RelativeLayout(相对布局)
4、TableLayout(表格布局)、FrameLayout(帧布局)
1、LinearLayout -线性布局
是页面中的所有组建都是按照线性布局,
纵向:
android:orientation="vertical" 表示组建垂直排成一列;
横向水平:
android:orientation="horizontal"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
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:text="@string/mobile"
android:id="@+id/mobilelable"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/mobilenumer"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/smslable"
android:id="@+id/smslable"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minLines="3"
android:id="@+id/messages"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/send_button"
android:id="@+id/sms_button"
/>
</LinearLayout>
2、AbsoluteLayout - 绝对布局
该布局方式:
1)给每个组建都要定义id,如一个组建:android:id="@+id/linearlayout"
2)例如另一个组建要位于该组建的下方则在组建中:android:layout_below="@id/linearlayout"
3)位于父控件的右侧:android:layout_alignParentRight="true"
还有其他的一些用法,如:位于父控件的左侧等等。
其实android布局方式就和Html中table布局类似,也可以布局嵌套,标签嵌套。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/linearlayout"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="@string/mobile"
android:id="@+id/mobilelable"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/mobilelable"
android:id="@+id/mobilenumer"
/>
</LinearLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/linearlayout"
android:textSize="18sp"
android:text="@string/smslable"
android:id="@+id/smslable"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/smslable"
android:minLines="3"
android:id="@+id/messages"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/messages"
android:layout_alignParentRight="true"
android:text="@string/send_button"
android:id="@+id/sms_button"
/>
</RelativeLayout>
3、RelativeLayout(相对布局)
4、TableLayout(表格布局)、FrameLayout(帧布局)
发表评论
-
Starting emulator for AVD 'android' PANIC: Could not open: android
2013-05-21 13:29 1952我的电脑-->属性-->高级-->环境变量。 ... -
eclipse4.2版本下面安装ADT,安装已经完成了,但没有ADT的那个图标显示
2013-05-21 13:26 958如果安装过程没错,直接在Eclipse ->window ... -
Android 打包签名 从生成keystore到完成签名 -
2012-10-30 00:49 965首先,我们需要一个keystore,当然已经有了的话就不用这一 ... -
解决更新并使用最新ADT20不能创建android项目问题
2012-10-18 22:20 1079不知道谷歌又怎么了,每次更新ADT插件就会出现各种各样的问题, ... -
ORACLE分页查询SQL语法
2012-10-18 22:20 1225oracle数据库 --1:无ORDER BY ... -
Activity生命周期
2012-10-18 22:20 1153博客分类: Android 新的activit ... -
布局
2012-10-18 22:21 1128padding:描述控件里面的内容与控件的关机,内边距;有四个 ... -
常用控件:TextView EditView
2012-10-13 13:32 1204TextView 布局: Xml代 ... -
按钮控件
2012-10-13 13:32 1197监听器: 监听器 方法 内容 OnClickList ... -
菜单
2012-10-13 13:31 1131menu键触发 三种形式:普通的option menu;上下 ... -
HttpClient
2012-10-13 13:31 1150在Android开发中我们经常会用到网络连接功能与服务器进行数 ... -
Android 的一些提示框
2012-10-08 00:57 8091.在测试时,如何实现一个提示 可以使用 Toast.ma ... -
Intent的几种用法
2012-10-08 00:57 956下面列出几种Intent的用法 1. 启动一个新的Activ ... -
Android改变窗口标题栏的布局
2012-10-10 23:26 953一、 重点 一般应用的Title都是建立应用时在Androi ... -
android中如何自定义attributes
2012-10-10 23:26 1014写程序中可能需要用到一些自定义的view控件,这样就需要增加一 ... -
android manifest.xml中元素含义
2012-10-08 00:56 865android:allowTaskReparenting 是 ... -
十二个android编程技巧
2012-10-10 23:26 10311.让一个图片透明: Java代码 1. Bitm ... -
Android Phone类分析
2012-10-10 23:26 1239AccelerometerListener:感应 ... -
android控件设置居中方式
2012-10-07 00:16 8489垂直居中 android:layout_centerVert ... -
android TextView属性大全
2012-10-10 23:28 1008android:autoLink设置是否当 ...
相关推荐
### Android页面布局详解 在Android开发中,布局是构建用户界面的基础。良好的布局不仅能够提升应用的美观度,还能提高用户体验。本文将详细介绍Android中三种常见的布局方式:LinearLayout(线性布局)、...
《Android页面布局初学者指南》 在Android应用开发中,页面布局是构建用户界面的核心,它决定了应用的外观和交互方式。"Android页面布局.zip"这个压缩包为初学者提供了一个绝佳的学习平台,包含了多种页面布局的...
本资源“Android页面布局代码”显然包含了有关如何创建和管理Android应用程序中用户界面的代码示例。这里我们将深入探讨Android布局的一些核心概念、常用布局类型以及布局代码的编写。 1. **XML布局文件**: ...
在Android应用开发中,页面布局是构建用户界面的关键部分,它定义了屏幕元素的排列方式、大小和相互关系。这个“android 中页面布局使用demo”应该是为了帮助开发者深入理解并实践Android中的各种布局管理器。下面...
本教程将深入探讨如何在Android页面布局中利用Fragment实现五个按钮的页面切换效果。 首先,我们需要了解Fragment的基本概念。Fragment并不是一个独立的应用组件,它必须依附于Activity才能运行。Fragment有自己的...
在Android移动应用开发中,页面布局是构建用户界面的基础,它是屏幕内容的组织方式,决定了元素的排列方式和相互关系。本篇文章将深入探讨四种主要的布局方式:线性布局、表格布局、相对布局和帧布局,以及如何进行...
在Android应用开发中,构建多页面布局是一种常见的需求,它能提供丰富的用户体验并允许用户在不同的内容之间平滑切换。本篇文章将详细讲解如何利用Fragment和ViewPager实现这一目标。 首先,Fragment是Android SDK...
本篇文章将详细介绍`StatusView`这一Android页面多状态布局切换控件的使用方法、功能特性以及实际应用。 首先,`StatusView`的核心思想是通过封装一个视图组件,使得开发者可以轻松地在正常内容视图、加载中视图、...
在Android开发中,页面布局是构建用户界面的关键部分。本文将详细介绍Android的五大布局:FrameLayout、LinearLayout、RelativeLayout、GridLayout和ConstraintLayout。 1. **FrameLayout**: FrameLayout是最基础...
本篇文章将深入探讨如何使用`Fragment`和`ViewPager`来构建一个常见的Android主页面布局,以及这两种组件的关键特性。 `Fragment`是Android SDK中一个核心组件,它允许你在单个活动中展示多个界面或者部分UI。`...
Sliding layout which can make your view or viewgroup float on your layout of Android application.可滑动的Android页面布局,上层View可以在一定范围内自由浮动,实现较为炫酷的页面效果~~
在Android开发中,有时我们需要将一个布局转换为图片,例如为了实现分享到微信的功能,或者进行屏幕截图。本文将深入探讨如何在Android中实现“布局生成图片”这一技术,以及如何将其与微信分享功能集成。 首先,让...
在Android开发中,为了使应用界面更具吸引力和用户体验,开发者经常需要实现各种独特的布局效果。本教程将聚焦于“门票布局”这一特定的设计,通过它,我们可以为应用增添一种新颖、有趣的视觉呈现方式,如同真实的...
在Android开发中,页面布局是构建用户界面的关键部分。本实验主要关注两种基本布局:线性布局(LinearLayout)和网格布局(GridLayout),并通过使用TextView标签来实现特定的视觉效果。 线性布局是Android中最基础...
标签布局常用于创建多标签页面,每个标签对应一个单独的视图。现在通常与`TabHost`和`ViewPager`一起使用,可以实现滑动切换不同的内容页。 7. **绝对布局(AbsoluteLayout)**(已废弃) 绝对布局允许开发者直接...
本主题将深入探讨如何使用代码编写Android界面布局源代码,以帮助开发者更好地理解和实践这一过程。 首先,Android界面通常由XML布局文件定义,但也可以通过编程方式动态创建。这种方式适用于那些需要在运行时根据...
在Android应用开发中,标签布局(Tab Layout)是一种常见的组件,用于展示多个可切换的页面或视图。这种布局能够帮助用户在多个相关内容之间轻松导航,通常与ViewPager结合使用,提供一个滑动浏览的界面。"一个...
本篇将深入探讨如何创建一个可动态布局的Android抽屉组件,提供一个完整的实现案例源码。 首先,抽屉组件的基本概念:DrawerLayout是Android提供的一个视图容器,它可以包含两个主要区域——主内容视图和一个或多个...
本压缩包“UI.rar”似乎包含了与Android UI设计相关的资源和示例,特别是涉及到不同的页面布局和交互元素。 首先,我们来深入理解Android UI的基础——布局(Layout)。布局在Android中是用来组织和控制屏幕上的...
在Android开发中,布局设计是构建用户界面的关键环节。"Android四等分布局Demo"是一个典型的实例,它展示了如何将屏幕划分为四个相等的部分,为用户提供清晰、均衡的显示效果。这种布局常用于创建网格系统,如卡片式...