布局文件layout背景色里:
<LinearLayout
android:layout_width="130dp"
android:layout_height="104dp"
android:background="@drawable/bg_frame"
android:orientation="vertical">
drawable/bg_frame.xml内容如下
<?xmlversion="1.0"encoding="UTF-8"?>
<laye..
分类:
移动开发 时间:
2015-04-24 16:45:31
阅读次数:
519
从手机中选择照片这是几乎所有应用的功能之一,主要考虑到一点的就是如果图片太大了,可能会OOM,简单的处理就是对图片进行压缩!
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
...
分类:
其他好文 时间:
2015-04-23 15:47:17
阅读次数:
160
直接上demo,用法都在程序的注释里了,首先上五渣效果图,
布局代码:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_...
分类:
移动开发 时间:
2015-04-23 09:43:13
阅读次数:
231
以一个简单的图片浏览器实例说明新建工程后:在activit_main.xml中添加代码:<?xmlversion="1.0"encoding="utf-8"?>
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="match_parent"
android:..
分类:
移动开发 时间:
2015-04-23 00:21:08
阅读次数:
158
需求:实现日历功能中的天数,在一个图标中显示当前日期的天数先上效果图:关键xml布局文件:<FrameLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_margin="4dp">
<ImageView
android:id="@+id/itemImage"
android..
分类:
移动开发 时间:
2015-04-22 16:16:03
阅读次数:
219
android:id="@+id/slidingdrawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:content="@+id/content"
android:handle="@+id/handle"
android:or...
分类:
移动开发 时间:
2015-04-22 11:38:22
阅读次数:
146
在android中选择图片是一个很常见的功能,图片的来源通常情况下是从相机获取和从相册获取两种。
先来写一个简单的选择按钮和一个能显示图片的ImageView<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
andr...
分类:
移动开发 时间:
2015-04-20 20:58:02
阅读次数:
188
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
andr...
分类:
其他好文 时间:
2015-04-20 18:35:19
阅读次数:
118
使用style替换背景,防止Activity黑色背景闪过1.原来的布局<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_...
分类:
移动开发 时间:
2015-04-17 22:25:19
阅读次数:
210
优化布局层次1.避免布局镶嵌过深(如下)<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_paren...
分类:
移动开发 时间:
2015-04-17 14:04:35
阅读次数:
183