自定义checkbox中的勾选框图标,这次因为想偷懒,图标弄的大了些,然后一系列的问题就都引出来了。
1、图标比checkbox的layout_height高,看不见了。
很吐血吧,CompoundButton中的源码可以看到下面代码
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
final Dra...
分类:
移动开发 时间:
2014-09-04 11:49:39
阅读次数:
232
一、概述抽屉控件,官方已不建议用;但在某些需求下直接使用这个控件还是相当方便的。<SlidingDrawer
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:handle="@+id/handle"
android:content="@+id/content"&g..
分类:
移动开发 时间:
2014-09-03 18:25:48
阅读次数:
349
先看看我们之前所写的代码
1) 添加权限:AndroidManifest.xml中必须使用了许可"android.permission.INTERNET"
2) 使用了一个WebView组件
android:id="@+id/wv"
android:layout_width="fill_parent"
android:layout_height="...
分类:
Web程序 时间:
2014-09-03 15:00:36
阅读次数:
302
1.布局文件
<LinearLayout
android:id="@+id/viewGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientat...
分类:
其他好文 时间:
2014-08-27 14:47:47
阅读次数:
186
1.关于searchView:
<SearchView
android:id="@+id/search_view"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:iconifiedByDefault="fal...
分类:
其他好文 时间:
2014-08-27 14:45:32
阅读次数:
280
1.在XHL中:android:id="@+id/spinner1"android:layout_width="match_parent"android:layout_height="wrap_content"android:entries="@+array/other" />在string.xml...
分类:
移动开发 时间:
2014-08-26 08:34:25
阅读次数:
212
有时候我们需要制作自定义的单选列表,但是会遇到一些问题,比如多选,假选问题,所以网上找了找资料,整理一个demo出来,贴一下代码:
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_co...
分类:
移动开发 时间:
2014-08-22 17:53:19
阅读次数:
381
<ListView android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="150dip"
a...
分类:
移动开发 时间:
2014-08-21 17:14:04
阅读次数:
245
先定义一个显示条目的xml布局文件
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation=...
分类:
移动开发 时间:
2014-08-12 17:10:44
阅读次数:
221
效果图:
在layout中这样来声明:
<com.kaixin001.view.ScrollText android:id="@+id/news_statustxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="1...
分类:
移动开发 时间:
2014-08-10 18:44:20
阅读次数:
327