Android UI使用总结
1. GridView 去掉press的蓝色背景
mGridView.setSelector(new ColorDrawable(Color.TRANSPARENT));
2. FragmentTabHost去掉分隔条
mTabHost.getTabWidget().setDividerDrawable(R.color.transparent);
3. 隐藏输入法:
((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(this
.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
4. Android中字体加粗
1)在xml文件中使用android:textStyle=”bold”
2)但是不能将中文设置成粗体,将中文设置成粗体的方法是:
TextView tv = (TextView)findViewById(R.id.TextView01);
TextPaint tp = tv.getPaint();
tp.setFakeBoldText(true);
5. ScrollView中元素不能占满ScrollView
android:fillViewport="true"
6. ScrollView禁用滚动
scrView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return true;
}
});
更多相关文章
- [置顶] Android输入法之——在代码中强制切换和获得当前输入法
- android paint设置字体 中文字体 楷体 和自动换行方法(zhuan)
- android Gridview中文API
- android 输入法的打开和关闭
- android 中文转拼音
- Android API 中文 (10) —— GridView
- android中文api:Manifest.permission group
- Android官方开发文档Training系列课程中文版:如何避免ANR?
- Android 2.2 r1 API 中文文档系列(11) ―― RadioButton