安卓开发中遇到问题的解决,网上搜索到的方法有一些问题,故而采用如下方法 方法/步骤 给activity布局文件加入 ?id <LinearLayout?xmlns:android="http://schemas.android.com/apk/res/android"?? ????x...
分类:
移动开发 时间:
2015-04-09 23:55:06
阅读次数:
326
废话不多说,直接上思路---
1:试想一个界面,父布局是LinearLayout,竖直方向排列,然后里面添加两个View,如果我点击第一个View,直接调用第二个View的scrollTo或者scrollBy方法,第二个View会移动吗?给出代码和布局文件----
布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/ap...
分类:
移动开发 时间:
2015-04-09 13:55:00
阅读次数:
200
1.activity_scrollview.xml 2、ScrollViewActivitypublic class ScrollViewActivity extends Activity { private LinearLayout mLayout; private ScrollView ...
分类:
移动开发 时间:
2015-04-08 23:17:37
阅读次数:
214
Android的界面是有布局和组件协同完成的,布局好比是建筑里的框架,而组件则相当于建筑里的砖瓦。组件按照布局的要求依次排列,就组成了用户所看见的界面。Android的五大布局分别是LinearLayout(线性布局)、FrameLayout(单帧布局)、RelativeLayout(相对布局)、AbsoluteLayout(绝对布局)和TableLayout(表格布局)。
LinearLa...
分类:
移动开发 时间:
2015-04-08 18:05:54
阅读次数:
202
做的一个简易QQ登陆界面,能够将账号及密码保存到手机中,并且再次启动该程序的时候会自动显示上次所保存下的账号及密码。
activityMain.xml :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas....
分类:
移动开发 时间:
2015-04-08 13:16:25
阅读次数:
198
下面是res/layout/activity_main.xml 布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_paren...
分类:
其他好文 时间:
2015-04-08 09:19:45
阅读次数:
142
手机卫士-08
课1
上一节课:软件管家改善 activityappmanager.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_pa...
分类:
移动开发 时间:
2015-04-07 17:49:31
阅读次数:
247
一般的APP软件都是需要下拉刷新,下拉加载这两个功能的,今天我们就来学习怎么样实现这两个功能。我们先来讲一下他们的原理,这里我们将采取的方案是使用组合View的方式,先自定义一个布局继承自LinearLayout,然后在这个布局中加入下拉头和ListView这两个子元素,并让这两个子元素纵向排列。初...
分类:
其他好文 时间:
2015-04-07 17:11:23
阅读次数:
194
手机卫士-05
课1
模仿网易新闻下拉加载分页数据listView
在activtiycallsafe.xml里重新修改(去掉原来的button)
activtiycallsafe.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_w...
分类:
移动开发 时间:
2015-04-07 15:37:29
阅读次数:
112
RelativeLayout又称作相对布局,也是一种非常常用的布局。
和LinearLayout的排列规则不同,它显得更加随意一些,它可以用过相对定位的方式让控件出现在布局的任何位置。
通过相对布局我们来实现这么一个东西:
android:layout_centerHorizontal="true" 通过这个属性可以让控件水平居中
android:layout_alig...
分类:
移动开发 时间:
2015-04-06 20:20:45
阅读次数:
186