Android小知识点总结
来源:互联网 发布:java 自然语言 编辑:程序博客网 时间:2024/06/02 04:58
1.AppIcon切图尺寸
drawable-xhdpi—-96 96
drawable-mdpi—–48 48
drawable-ldpi—–36 36
drawable-hdpi—–72 72
2.横竖屏切换想要不重新执行生命周期需配置
android:configChanges=”orientation|keyboardHidden|screenSize”
配置后只会执行onConfigurationChanged方法。
3.ListView子条目上有按钮优先级问题
可以在子布局根目录,也就是Item布局的根目录添加以下属性android:descendantFocusability=”blocksDescendants”
4.ScrollView中套用ListView时直接跳转到ListView记录第一条位置
可以在父布局元素下添加以下属性
android:focusable="true"android:focusableInTouchMode="true"
5.页面背景变成黑色
尝试修改主题为android:theme=”@android:style/Theme.Light.NoTitleBar”
6.弹出软键盘修改右下角按钮
imeOptions一共有4个属性值:
actionUnspecified 未指定,对应常量EditorInfo.IME_ACTION_UNSPECIFIED.
actionNone 没有动作,对应常量EditorInfo.IME_ACTION_NONE
actionGo 去往,对应常量EditorInfo.IME_ACTION_GO
actionSearch 搜索,对应常量EditorInfo.IME_ACTION_SEARCH
actionSend 发送,对应常量EditorInfo.IME_ACTION_SEND
actionNext 下一个,对应常量EditorInfo.IME_ACTION_NEXT
actionDone 完成,对应常量EditorInfo.IME_ACTION_DONE
android:imeOptions="actionSearch" android:singleLine="true"
然后添加点击事件
7.在String.xml中添加空格时用以下方式view.setOnEditorActionListener(new OnEditorActionListener() {public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {if (actionId == EditorInfo.IME_ACTION_SEARCH) {// 点击搜索后隐藏键盘`((InputMethodManager) title_searck.getContext().getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);return true;}return false;}});
 ;(后面的分号要带)
- 【android】小知识点总结
- Android小知识点总结
- Android小知识点总结
- android 开发小知识点总结
- Android系统小知识点总结
- android开发小知识点之Activity总结
- 【小知识点总结】android判断横竖屏
- Android 小知识点总结(2016-7-27)
- Android小知识点总结-持续更新
- 小总结之Android知识点(1)
- .net小知识点总结
- DataGridView小知识点总结
- GDI+ 小知识点总结
- MYSQL小知识点总结
- 小知识点总结三
- 前端小知识点总结
- 小知识点总结
- 小知识点总结
- DeepLearning tutorial(1)Softmax回归原理简介+代码详解
- poj 2135 Farm Tour(最小费用最大流)
- 【项目管理和构建】eclipse配置maven + 创建maven项目(三)
- HDOJ 5807 Keep In Touch
- DatePicker 控件的使用 android 开发
- Android小知识点总结
- vs2013-qt5编译兼容xp时常遇问题
- 143.Count Numbers with Unique Digits
- C语言自学之路
- 文件压缩
- linux下进行C语言编程详解
- 使用OpenSSL制作ecc证书
- 线程同步条件变量
- 【HDU 1075】What Are You Talking About(字典树)