![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android控件常用属性
YK_love_GQ
暂时没有
展开
-
TextView
设置文本颜色 tv.setText(Html.fromHtml("<font color = green>" + taskNum + "</font>" + "条任务," + "<font color = red>" + undoTaskNum + "</font>" + "原创 2012-04-28 14:16:48 · 77 阅读 · 0 评论 -
ListView
去掉拖动时候的黑色阴影 android:cacheColorHint="#00000000" 或者 listview.setCacheColorHint(0); 对于ListActivity也一样,只需要在onCreate中加上 this.getListView().setCacheColorHint(0); 设置List Item选中时候的颜色(设置选中颜色为白色) ...原创 2012-02-22 10:56:03 · 106 阅读 · 0 评论 -
EditText
保持默认在 左、上边 android:gravity=left|top 让光标放入到点击位置 edittext.requestFocusFromTouch(); 默认方式获得焦点 edittext.requestFocus(); 光标处插入 EditText editor = (EditText)getCurrentView();// int cursor ...原创 2012-03-29 18:11:20 · 96 阅读 · 0 评论 -
DatePicker和TimePicker的使用
datePicker.init(datePicker.getYear(), datePicker.getMonth(), datePicker.getDayOfMonth(), new OnDateChangedListener(){ public void onDateChanged(DatePicker view, int year, int monthOfYea...原创 2012-03-31 20:41:14 · 117 阅读 · 0 评论 -
键盘相关
虽然很简单,而且没有什么价值,但还是记录一下方便自己查找使用: InputMethodManager inputMethodManager=(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.toggleSoftInput(0, InputMet...原创 2012-11-21 16:13:48 · 87 阅读 · 0 评论 -
ImageView
使用ImageView旋转图片或缩放图像: Bitmap bm = ((BitmapDrawable)getResources().getDrawable(R.drawable.ic_launcher)).getBitmap(); Matrix matrix = new Matrix(); //matrix.setScale((float)1.5, (float)1.5);...原创 2013-01-20 17:02:42 · 128 阅读 · 0 评论 -
ProgressBar
做过Android开发的同学应该都不会对这个控件陌生。主要是用来实现处理或加载进度的显示或者提示用户正在处理或加载数据。 基本来说就两种情况,一种是转圈的小菊花,一种是水平的进度条。 默认情况下ProgressBar是圆形的那种,如果你要设置成水平状的,需要加入style style="?android:attr/progressBarStyleHorizontal" 这两种形式的默认...2013-01-21 17:21:14 · 193 阅读 · 0 评论