2012年5月22日
摘要: View.INVISIBLE跟View.GONE有什么差别:INVISIBLE:仍旧会占用空间,只是内容不显示。GONE:不会占用空间。View 的setVisibility有三个值可以设置:VISIBLE--->可见INVISIBLE--->不可见,但这个View在ViewGroupt中仍保留它的位置,不重新layoutGONE---->不可见,但这个View在ViewGroupt中不保留位置,重新layout,那后面的view就会取代他的位置。注意:若你在Adapter中的getView或bindview将某些特殊的位置的View.INVISIBLE之后,要记得在别的判断 阅读全文
posted @ 2012-05-22 18:05 清沁 阅读(534) 评论(0) 推荐(0) 编辑
摘要: public class mainactivity extends Activity implementsOnItemSelectedListener, ViewFactory {private ImageSwitcher is;private Gallery gallery;private Integer[] mThumbIds = { R.drawable.b, R.drawable.c,R.drawable.d, R.drawable.f, R.drawable.g};@Overrideprotected void onCreate(Bundle savedInstanceState) 阅读全文
posted @ 2012-05-22 16:58 清沁 阅读(468) 评论(0) 推荐(1) 编辑
摘要: 最近做listview和button都要改变Android原来控件的背景,在网上查找了一些资料不是很全,所以现在总结一下android的selector的用法。首先android的selector是在drawable/xxx.xml中配置的。先看一下listview中的状态:把下面的XML文件保存成你自己命名的.xml文件(比如list_item_bg.xml),在系统使用时根据ListView中的列表项的状态来使用相应的背景图片。drawable/list_item_bg.xmlJava代码:1.<?xmlversion="1.0"encoding="ut 阅读全文
posted @ 2012-05-22 10:00 清沁 阅读(297) 评论(0) 推荐(0) 编辑