码迷,mamicode.com
首页 >  
搜索关键字:findviewbyid    ( 816个结果
android spinner 每行字体颜色都变化
final static int[] COLOR_LIST={Color.WHITE,Color.WHITE,Color.GRAY,Color.YELLOW,Color.RED}; spinner=(Spinner)findViewById(R.id.spinner1); ArrayA...
分类:移动开发   时间:2014-12-25 22:00:44    阅读次数:313
andrioid 在textview文字上划一条线
代码如下: String?string?=?"市场价:¥158.00"; TextView?textView?=?(TextView)?findViewById(R.id.textView); SpannableString?sp?=?new?SpannableString(string); sp.setSpan(new?Strikethrough...
分类:其他好文   时间:2014-12-25 11:34:42    阅读次数:699
android WebView网页浏览器
组件位置:composite>WebView.xml1 .java1 private WebView webview_pipeweb;2 3 webview_pipeweb = (WebView) findViewById(R.id.webview_pipeweb);4 //setWebVi...
分类:移动开发   时间:2014-12-24 17:35:29    阅读次数:138
Android的TextView使用Html来处理图片显示、字体样式、超链接等
一、[Android实例]实现TextView里的文字有不同颜色转eoe:http://www.eoeandroid.com/thread-4496-1-1.htmlimport android.text.Html;TextView t3 = (TextView) findViewById(R.id...
分类:移动开发   时间:2014-12-24 13:09:50    阅读次数:155
Android一个TextView设置多种颜色
有时候一个文本框为了强调内容需要显示不同颜色,用以下代码可以轻松实现 //为文本框设置多种颜色 textView=(TextView)findViewById(R.id.text_show); SpannableStringBuilder style = new SpannableStringBuilder("备注:签收人(张三)"); style...
分类:移动开发   时间:2014-12-24 00:02:08    阅读次数:303
setWidth()和setHeight()没反应的问题,onCreate()里面获取控件的高度是0
editText=(EditText)findViewById(R.id.myEditText); // editText.setHeight(10); //不生效 editText.getLayoutParams().height = 100; onCreate()里...
分类:其他好文   时间:2014-12-22 12:55:19    阅读次数:161
LayoutInflater作用及使用
作用:用来实例化一个XML文件到指定View中。与findViewById类似,不同的是LayoutInflater找的res文件下的没有被载入或需动态被载入,对于已经载入的Activity可以使用findViewById来获得其中的界面元素。获得LayoutInflater的几种方式:1. Lay...
分类:其他好文   时间:2014-12-19 12:54:20    阅读次数:152
访问 views onCreate()方法报NullPointerException
我跟着教程 ,通过向导创建了一个新的activity ,当我运行时在 onCreate方法里面调用findViewById()方法时报错 NullPointerException 。 Layout XML (fragment_main.xml): http://schemas.android.com/apk/res/android" xmlns:tools="http://schem...
分类:其他好文   时间:2014-12-19 12:19:43    阅读次数:214
LayoutInflater(转)
在实际工作中,事先写好的布局文件往往不能满足我们的需求,有时会根据情况在代码中自定义控件,这就需要用到LayoutInflater。LayoutInflater在Android中是“扩展”的意思,作用类似于findViewById(),不同的是LayoutInflater是用来获得布局文件对象的,而...
分类:其他好文   时间:2014-12-17 23:54:29    阅读次数:349
Android屏幕截图详解
Android屏幕截图功能实现这里介绍两种方式:      第一种 截取整个屏幕实现方式三种   ImageView imgV = (ImageView) findViewById(R.id.ImageView01);   ImageView imgV2 = (ImageView) findViewById(R.id.ImageView02);   ImageView imgV3 ...
分类:移动开发   时间:2014-12-17 21:04:03    阅读次数:185
816条   上一页 1 ... 62 63 64 65 66 ... 82 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!