- 浏览: 890006 次
- 性别:
- 来自: 深圳
-
文章分类
- 全部博客 (509)
- android (55)
- CSS (23)
- eclipse (25)
- Data Structes and Algorithms (53)
- J2SE (87)
- Java_面试学习_j2se (26)
- java_面试学习_非技术 (13)
- java_gui (2)
- java_设计模式 (27)
- JDBC (10)
- java_web (15)
- hibernate (5)
- Oracle (37)
- Struts2 (7)
- Word-----dos (24)
- Jbpm (3)
- java小技巧 (8)
- math (1)
- flex (12)
- WebService (4)
- 生活 (9)
- 小框架或小语言 (27)
- spring (1)
- 面试~~~软实力 (7)
- jstat的用法 (1)
- jmap (1)
- 数据链路层和传输层的流量控制区别 (1)
- shell (0)
- 财商 (1)
- javascript (0)
- js研究 (1)
- 代码收集 (0)
最新评论
-
海尔群:
http://jingyan.baidu.com/articl ...
android加密 -
完美天龙:
------------------------- ...
asm----字节码操纵 -
houniao1990:
大神,请问 string 类型 定义为 oracle的 cha ...
hibernate注解 -
JamesQian:
Line:103
f.doFilter(msg);
是否需 ...
责任链模式_过滤器模式 -
sacoole:
好评
interview--- 如何从N个数中选出最大(小)的n个数?
横向线性布局加relativeLayout
-----------------------------------------------------------------------
LinearLayout ,
---------------------------------------------------------------
Table布局
------------------------------------------------------
相对布局
----------------------------------------------
Frame布局
----------------------------------
对于每种布局,都有专属的xml语句,有些xml就、语句是在其他地方运行不出来的
FrameLayout
如果要在FrameLayout里面调整控件的位置,
在他下属的控件或者是layout里面 android:layout_gravity="bottom"(也可以是top~~~)是最好用的
注意:android:layout_gravity="left"这个属性似乎在哪里都可以用,就是本布局与上一布局的关系。
RelativeLayout:
下属控件用:android:layout_centerHorizontal="true" 居中
android:layout_alignParentLeft
android:layout_toLeftOf
android:layout_alignLeft
LinearLayout
<LinearLayout android:orientation="vertical"
android:gravity="center" ----这是让他下面的组件居中
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:layout_gravity="bottom" android:background="#80000000">

public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout layoutMain = new LinearLayout(this); layoutMain.setOrientation(LinearLayout.HORIZONTAL); setContentView(layoutMain); LayoutInflater inflate = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);//xml加载器 RelativeLayout layoutLeft = (RelativeLayout) inflate.inflate( R.layout.left, null); RelativeLayout layoutRight = (RelativeLayout) inflate.inflate( R.layout.right, null); RelativeLayout.LayoutParams relParam = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); layoutMain.addView(layoutLeft, 100, 100);//先加入第一个相对布局的xml,并规定宽度和高度 layoutMain.addView(layoutRight, relParam);//剩下的空间由这个相对布局xml填充 }
-----------------------------------------------------------------------
LinearLayout ,

<Button android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="上" /> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" > <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="右下" /> </LinearLayout>
---------------------------------------------------------------
Table布局

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:text="表头" /> <TableRow android:gravity="center" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="第0列" --android:layout_marginLeft="10dip" > </TextView> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="第1列" > </TextView> </TableRow> <TableRow android:gravity="center" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按钮1" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按钮2" /> </TableRow> </TableLayout>
------------------------------------------------------
相对布局

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="中间的按钮,很长很长很长" android:layout_centerInParent="true" > </Button> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="上面的按钮" android:layout_above="@id/button1" android:layout_alignLeft="@id/button1" > </Button> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="下面的按钮" android:layout_below="@id/button1" android:layout_alignRight="@id/button1" --android:layout_alignParentRight="true" 这个也常用 > </Button> </RelativeLayout>
----------------------------------------------
Frame布局

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/big" > </ImageView> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/center" > </ImageView> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/small" > </ImageView> </FrameLayout>
----------------------------------
对于每种布局,都有专属的xml语句,有些xml就、语句是在其他地方运行不出来的
FrameLayout
如果要在FrameLayout里面调整控件的位置,
在他下属的控件或者是layout里面 android:layout_gravity="bottom"(也可以是top~~~)是最好用的
注意:android:layout_gravity="left"这个属性似乎在哪里都可以用,就是本布局与上一布局的关系。
RelativeLayout:
下属控件用:android:layout_centerHorizontal="true" 居中
android:layout_alignParentLeft
android:layout_toLeftOf
android:layout_alignLeft
LinearLayout
<LinearLayout android:orientation="vertical"
android:gravity="center" ----这是让他下面的组件居中
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:layout_gravity="bottom" android:background="#80000000">
发表评论
-
EditText失去焦点
2011-12-25 13:57 1125<LinearLayout andr ... -
调用照相机和相册
2011-12-21 19:26 1538直接下代码看吧。。 ... -
wifi流程详细分析
2011-12-09 23:56 10991一.启动wifi服务 1.在 S ... -
Android WifiManager 常量
2011-12-09 00:20 6098ACTION_PICK_WIFI_NETWORK Activ ... -
android 探索首选项框架xxxPreference
2011-12-08 20:50 1802http://blog.csdn.net/qinjuning/ ... -
Wifi
2011-12-02 15:02 1741. Confirm if Wifi is On Usin ... -
Tab
2011-12-01 16:02 1297public class MyTab extends ... -
color
2011-12-01 10:48 1147<?xml version="1.0&qu ... -
EditText属性解释
2011-12-01 09:31 2471EditText继承关系:View-->TextView ... -
Android之Inflate()方法用途
2011-11-30 10:40 3235原文: Inflate()作用就是将xml定义的一个布局找出 ... -
android 自定义listview无法响应点击事件OnItemClickListener
2011-11-29 22:34 2828如果你的自定义ListViewItem中有Button或者 ... -
事件event
2011-11-29 22:34 1045private class OnItemClickLis ... -
gridView ---图片显示类九宫格
2011-12-01 09:23 3188<GridView xmlns:android= ... -
Image gallery
2011-11-25 14:36 5<ImageSwitcher ... -
Image gallery
2011-11-25 14:36 1163public class ImageShowActiv ... -
Image gallery
2011-11-25 14:36 4public class ImageShowActiv ... -
Image gallery
2011-11-25 14:36 4public class ImageShowActiv ... -
Image gallery
2011-11-25 14:36 4public class ImageShowActiv ... -
Menu
2011-11-25 11:22 1074按menu按钮弹出来的东西 public static ... -
listView
2011-11-25 10:35 2232android.R.layout.simple_list_it ...
相关推荐
Android应用源码安卓多边形布局例子.rar Android应用源码安卓拍照上传实现代码附带php端.rar Android应用源码实现动态交叉布局.rar Android应用源码小说翻页效果源码.rar Android应用源码广告轮播效果源码.rar ...
通过深入学习和理解Android StaggeredGrid的源码,开发者可以更好地掌握瀑布流布局的实现原理,同时也能灵活地根据需求定制和优化布局。源码阅读不仅可以提升技术能力,还有助于解决实际开发中遇到的问题,例如如何...
通过分析和实现微信的源码,开发者不仅能学习到Android布局设计的技巧,还能深入理解Android应用开发的各种技术,包括数据持久化、网络请求、多线程、权限管理等方面的知识。同时,这也是一种提高自己编程能力、解决...
在安卓(Android)开发中,UI界面是用户体验的关键部分,其源码的解析与理解对于开发者来说至关重要。这个名为“安卓Android源码——UI界面源码.zip”的压缩包,很显然是一个包含Android用户界面(UI)相关源代码的...
《Android Studio项目源码解析与学习指南》 在Android应用开发的世界中,Android Studio作为官方推荐的集成开发环境(IDE),已经成为开发者们的首选工具。本文将深入探讨"50款Android studio项目源码.zip"这一资源...
Android布局详解实例,包含:线性布局(LinearLayout)、相对布局(RelativeLayout)、帧布局(FrameLayout)、表格布局(TableLayout)四大布局方式的demo
【Android_高仿微信5.2布局源码详解】 在Android开发中,高仿其他流行应用的界面布局是一种常见的学习和提升技术的方式。本资源提供的是针对微信5.2版本的高仿源码,这对于想要深入理解Android UI设计以及微信交互...
本源码项目是基于Android Studio的安卓布局设计,包含81个文件,主要使用Java编程语言。该项目适用于学习安卓布局代码,开发环境包括Windows 10、JDK 1.8、SDK 33、Android 1、Android Studio 2021.2.1以及Git ...
本文将深入探讨如何自己设计一个精美的布局,基于Android UI设计原则和源码实现。我们将从以下几个方面来展开讨论: 1. **Android UI设计基础**: Android UI设计遵循Material Design规范,它提供了一套系统化的...
这个压缩包"安卓Android源码——android模仿易信UI布局效果源码.zip"提供了一个实战案例,帮助开发者了解如何模仿流行通讯应用易信的用户界面(UI)布局。易信的UI设计以其简洁、清晰和易于操作而著称,因此,通过...
4. **UI布局与适配**:源码会包含多种布局文件,用于适应手机和平板等不同设备的屏幕尺寸。可能会使用LinearLayout、RelativeLayout或ConstraintLayout等布局,以及使用比例单位dp/sp,确保界面在不同分辨率下适配...
2. **布局设计**:Android布局设计是构建UI的基础,包括线性布局(LinearLayout)、相对布局(RelativeLayout)、帧布局(FrameLayout)等。易信的UI布局可能会结合多种布局,以实现不同组件的精确对齐和动态交互。 ...
源码可能基于特定版本的Android SDK,因此确保你的开发环境与之兼容至关重要。 2. **项目结构**:Android应用通常遵循特定的目录结构,如`app/src/main/java`存放Java或Kotlin代码,`app/src/main/res`包含XML资源...
Android游戏源码通常包含Activity、布局XML文件、图片资源、音频资源以及核心逻辑代码等组成部分。贪吃蛇游戏的核心部分主要涉及游戏循环、碰撞检测、食物生成和蛇的移动逻辑。 1. **游戏循环**:在Android中,游戏...
"android瀑布流布局源码"中的"PinterestLikeAdapterView-master"很可能就是一个实现了瀑布流布局的开源项目。 首先,我们来看自定义ViewGroup的方式。开发者需要继承ViewGroup,重写onMeasure()和onLayout()方法,...
本项目为基于CoordinatorLayout的Android布局设计源码,包含321个文件,其中包含146个Java源文件、91个XML布局文件、47个PNG图片资源、8个Gradle构建文件、6个Git忽略配置文件、5个项目配置文件、5个图片文件、3个...
【Android旅游APP源码】 这个压缩包文件"Android旅游APP源码.zip"包含了一个完整的Android应用程序源代码,专为旅游领域设计。通过分析其包含的文件,我们可以深入了解Android应用开发的一些核心概念和技术。 1. ...
源码中包含了各种布局文件(如XML),定义了商品列表、详情页、购物车、订单等界面的布局结构。同时,可能会使用自定义View和动画效果来提升用户体验。 3. **网络请求与数据解析** 商城APP需要与服务器进行大量的...
在Android平台上,开发一款音乐播放器应用是一项常见的任务,它涉及到多媒体处理、用户界面设计以及与设备硬件的交互等多个方面。本项目是一个基于Android Studio的音乐播放器APP源码,对于学习Android应用开发,...