上一页 1 ··· 9 10 11 12 13
摘要: 一般来讲,我们用LayoutInflater做一件事:inflate。inflate这个方法总共有四种形式,目的都是把xml表述的layout转化为View。This class is used to instantiate layout XML file into its corresponding View objects . It is never be used directly -- use getLayoutInflater() or getSystemService(String)getLayoutInflater() or getSystemService(String) to 阅读全文
posted @ 2012-04-07 15:48 網絡蛀蟲 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Inflater英文意思是膨胀,在Android中应该是扩展的意思吧。LayoutInflater的作用类似于 findViewById(),不同点是LayoutInflater是用来找layout文件夹下的xml布局文件,并且实例化!而 findViewById()是找具体某一个xml下的具体 widget控件(如:Button,TextView等)。(0)她可以有很多地方可以使用,如BaseAdapter的getView中,自定义Dialog中取得view中的组件widget等等。它的用法有2种:view plaincopy to clipboardprint? LayoutInflat. 阅读全文
posted @ 2012-04-07 15:46 網絡蛀蟲 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 很 多时候,利用触摸屏的Fling、Scroll等Gesture(手势)操作来操作会使得应用程序的用户体验大大提升,比如用Scroll手势在 浏览器中滚屏,用Fling在阅读器中翻页等。在Android系统中,手势的识别是通过 GestureDetector.OnGestureListener接口来实现的,不过William翻遍了Android的官方文档也没有找到一个相 关的例子,API Demo中的TouchPaint也仅仅是提到了onTouch事件的处理,没有涉及到手势。Android Developer讨论组里也有不少人有和我类似的问题,结合他们提到的方法和我所做的实验,我将给大家简单讲 阅读全文
posted @ 2012-04-05 22:45 網絡蛀蟲 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 作者:lenomon 发布:2011-11-25 13:54 分类:AndroidAndroid中提供了ViewGroup、View、Activity三个等级的Touch事件处理。也就是说,这三个地方都有事件回调方法。测试DEMO视图结构: 1 <com .orgcent.eventtest.EventLinearLayout 2 xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="fill_parent" 4 android:layo 阅读全文
posted @ 2012-04-05 22:18 網絡蛀蟲 阅读(341) 评论(0) 推荐(0) 编辑
摘要: String ADD_SHORTCUT_ACTION 动作:在系统中添加一个快捷方式。. "android.intent.action.ADD_SHORTCUT" String ALL_APPS_ACTION 动作:列举所有可用的应用。 输入:无。 "android.intent.action.ALL_APPS" String ALTERNATIVE_CATEGORY 类别:说明 activity 是用户正在浏览的数据的一个可选操作。 "android.intent.category.ALTERNATIVE" String ANSWE 阅读全文
posted @ 2012-04-05 22:00 網絡蛀蟲 阅读(387) 评论(0) 推荐(0) 编辑
摘要: Android™ 2.1 android.R.drawable Icon ResourcesAndroid™ 1.5 android.R.drawable Icon ResourcesAndroid™ 1.6 android.R.drawable Icon ResourcesAndroid™ 2.1 android.R.drawable Icon ResourcesOriginated from: http://www.darshancomputing.com/android/1.5-drawables.htmlThis is a list of resources in Android 2. 阅读全文
posted @ 2012-04-04 21:53 網絡蛀蟲 阅读(5887) 评论(1) 推荐(0) 编辑
摘要: 这篇博文包括的内容:1、TableLayout简介2、TableLayout行列数的确定3、TableLayout可设置的属性详解4、一个包含4个TableLayout布局的实例及效果图一、Tablelayout简介 Tablelayout类以行和列的形式对控件进行管理,每一行为一个TableRow对象,或一个View控件。 当为TableRow对象时,可在TableRow下添加子控件,默认情况下,每个子控件占据一列。 当为View时,该View将独占一行。二、TableLayout行列数的确定 TableLayout的行数由开发人员直接指定,即有多少个TableRow对... 阅读全文
posted @ 2012-03-30 13:17 網絡蛀蟲 阅读(1333) 评论(0) 推荐(1) 编辑
摘要: 当然除了使用drawable这样的图片外今天谈下自定义图形shape的方法,对于Button控件Android上支持以下几种属性shape、gradient、stroke、corners等。我们就以目前系统的Button的selector为例说下: <shape> <gradient android:angle="270" android:endColor="#FFFFFF" android:startColor="#ff8c00" /> <stroke android:width="2dp&q 阅读全文
posted @ 2012-03-29 20:43 網絡蛀蟲 阅读(492) 评论(0) 推荐(0) 编辑
摘要: 这几天做项目,用到背景选择器,无论怎么弄,都没有效果,找了很多资料都没有找到,样式是这样的<?xml version="1.0" encoding="UTF-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/title_new_normal"/> <item android:drawable="@dr 阅读全文
posted @ 2012-03-29 20:35 網絡蛀蟲 阅读(2085) 评论(2) 推荐(0) 编辑
摘要: (\d+,?)+\.?\d*测试数据:¥1,000,555,555.00结果:1,000,555,555.00---------------------------------------------------------数据:¥1,000,555,555结果:1,000,555,555---------------------------------------------------------数据:¥100055555500结果:100055555500 阅读全文
posted @ 2012-03-12 14:22 網絡蛀蟲 阅读(190) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13