摘要:Building Custom ComponentsAndroid提供了一套精巧的强大的组件化的模型供你创建你的UI,它们是基于layout的View和ViewGroup的类.这个平台提供了许许多多的已经建好的View和ViewGroup子类-被称为widgets 和 layouts,正如所预期的那样.你可以用这些构造你自己的UI.一部分可用的widgets包括 Button, TextView, EditText, ListView,CheckBox, RadioButton, Gallery, Spinner,和更多特殊用途的widgets: AutoCompleteTextView, I
阅读全文
摘要:Applying Styles and Themes一种Style就是许多具体样子和View或者window的的格式属性的集合.一种Style可以具体化高度,间距,字体颜色,字体大小,背景色,还有其他多种属性.一种Style在一个和布局xml文件分开的xml源文件中被定义.Android中的Style类似用来覆盖在网页设计中的样式表-它们允许你将内容和设计分开来.例如用如下style将如下xml文件:<TextView android:layout_width="fill_parent" android:layout_height="wrap_content
阅读全文
摘要:Notifying the User本文测试代码csdn下载频道:http://download.csdn.net/source/2907960通知用户的方式包括3种.一种是Toast一种是Status Bar(状态栏),还有一种是前面已经提到过的Dialog(对话框).具体的我就不介绍了,因为网上也介绍的比较清楚.我就把怎么用的,然后使用过程中,需要注意到的一些写一下.这样读者读起来就比较轻松了.1.Creating Toast Notifications首先,要具体化一个Toast对象用makeText()方法.这个方法需要3个参数.包括应用程序的Context,text message,
阅读全文
摘要:Handling UI Events在android中,有多种拦截用户与你的应用程序之间交互的方式.当考虑到你的用户接口事件,倾向是捕捉从具体的与用户交互的View对象中产生的Event.view类提 供了这些方法让你这样做.随着,这么多的你可能用于组成你的布局的view 类,你可能注意到若干公共的看起来对用户接口事件有用的回调方法.这些方法当预期的action发生的发该对象上时,被称作android 的framework(框架).举例来说,当一个View(例如一个Button)被按下时,onTouchEvent()就被该对象调用.然而,为了拦截这个action,你必须扩展这个类,然后重写这个
阅读全文
摘要:Creating DialogsAndroid中的Dialog,(既对话框). 包括1)AlertDialog 2)ProgressDialog 3)DatePickerDialog 4)TimePickerDialog 5)Custom Dialog本文测试代码csdn下载频道:http://download.csdn.net/source/2903639我发现要将文档理顺,其实最好就是全文翻译,但我不想这么做,我就把大致的理一下.方便自己和别人以后查阅使用.AlertDialogA dialog that can manage zero, one, two, or three button
阅读全文
摘要:Creating Menusandroid 菜单包括三种.Options Menu, Context Menu 和Submenu.本文完整代码CSDN下载频道:http://download.csdn.net/source/2900952 ,1.Options Menu(选项菜单)@方法1 需要重写public boolean onCreateOptionsMenu(Menu menu)和public boolean onOptionsItemSelected(MenuItem item)方法,可用如下代码,添加menuitem@Override public boolean onOptio.
阅读全文
摘要:Learn to fail or fail to learn.As we know about Obama(i don't know exactly how his name spelled).The American president.Whatcan we learn from him.Or we just see a man with black skin ,be in a freedom culture and strong country'shighest position.Or we just see a man's inflence by his work
阅读全文