??场景:实现安装一个apk应用程序的过程。界面如下:编写如下应用,应用结构如下: RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width=...
分类:
移动开发 时间:
2015-07-21 01:33:15
阅读次数:
215
在Android画线必须由一个载体,无论是控制,无论是布局。实际上它们是从继承View。由画线的方式自己的控制或布局的定义是最常见的。以下是在其定义中的小样本实现RelativeLayout绘制网络格线代码下载:http://download.csdn.net/detail/yxg190221/75...
分类:
其他好文 时间:
2015-07-20 12:11:58
阅读次数:
147
Android调用系统api使用照相机功能,实现拍照获取图片以及从照相机库中获取指定图片的功能。
以下是示例代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="match...
分类:
移动开发 时间:
2015-07-19 16:32:08
阅读次数:
205
———-方法一:———-效果图:需要的组件:ViewPager+PagerTabStrip布局文件代码:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/re...
分类:
其他好文 时间:
2015-07-16 20:05:19
阅读次数:
989
布局添加动画使用步骤:1.获取到布局的id1 RelativeLayout ly=(RelativeLayout)findViewById(R.id.layout);2.设置动画样式1 ScaleAnimation sa = new ScaleAnimation(0, 1,0,1); //设置动画....
分类:
移动开发 时间:
2015-07-16 16:03:34
阅读次数:
161
标签用于减少View树的层次来优化Android的布局新建项目,不需要改动运行后使用“DDMS -> Dump View Hierarchy for UI Automator”工具,得到结果最下面两层RelativeLayout与TextView就是activity_main.xml布局中的内容,上...
分类:
其他好文 时间:
2015-07-16 15:40:29
阅读次数:
204
今天写了几行极为简单的代码,就是想implements View.OnCLickListener.然后实现按钮点击操作。但是按钮却没有反应,找了五分钟还是没有结果。
以下是我的代码,希望大家不要嘲笑:
XML布局如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android...
分类:
移动开发 时间:
2015-07-16 12:05:32
阅读次数:
194
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layou...
分类:
移动开发 时间:
2015-07-16 11:57:24
阅读次数:
221
现需要交换两个控件(本文中是两个RelativeLayout),找到了两个方法:
1、使用LayoutParams改变两个layout的属性,即其相对关系(below等),实现位置的交换,但是并没有交换的动画效果,是“瞬间”交换。
2、使用animation交换控件位置,实现了我需要的动画效果。
如下图,交换layoutOne 与layoutTwo 。
一、...
分类:
移动开发 时间:
2015-07-15 22:49:16
阅读次数:
411
activity_main.xml:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_he...
分类:
其他好文 时间:
2015-07-15 17:07:48
阅读次数:
124