杂记
来源:互联网 发布:什么是滤波算法 编辑:程序博客网 时间:2024/05/21 10:35
1.EditText自动获取焦点弹出软键盘
为了防止上述情况,可以在其父级控件中添加如下属性:
android:focusable="true" android:focusableInTouchMode="true"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:focusable="true" android:focusableInTouchMode="true" >
2.ListView不显示滚动条
添加下面的属性:
android:scrollbars=”none”
<ListView android:id="@+id/order_list_show" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="@dimen/spacing_normal" android:scrollbars="none" />
3.ListView不显示分割线
做如下配置
android:divider=”@null”
<ListView android:id="@+id/order_list_show" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="@dimen/spacing_normal" android:divider="@null" />
4.TextView多行文字的间距
添加如下属性
android:lineSpacingExtra=”@dimen/spacing_normal”
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:lineSpacingExtra="@dimen/spacing_normal" android:padding="@dimen/spacing_normal" android:textColor="@color/black" android:textSize="@dimen/font_normal" />
5.EditText修改hint的字体颜色
添加如下属性
android:textColorHint=”@color/deep_gray”
<EditText android:id="@+id/destination" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColorHint="@color/deep_gray" />
6.除去Button默认的padding
其实button是默认设置了 android:minHeight,android:minWidth属性
在属性中设置为0,即可消除
<Button android:minHeight="0dp" android:minWidth="0dp" android:padding="@dimen/spacing_small" />
7.打包所有渠道正式的apk包
gradlew assembleRelease
8.特殊符号
 
空格
<
<
>
>
9.各图标大小
mdpi 48pxhdpi 72pxxhdpi 96pxxxhdpi 144pxxxxhdpi 192px
10.TextView超过一行自动省略
maxLines和ellipsize结合使用即可
<TextView android:layout_width="match_parent" android:layout_height="match_parent" android:maxLines="1" android:ellipsize="end"/>
0 0
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- ios 证书无法生成p12 文件解决,或者无法生成秘钥
- android view视图的层叠(叠加)
- C++学习之深入理解虚函数--虚函数表解析
- 欢迎使用CSDN-markdown编辑器
- KMP算法
- 杂记
- Algorithms
- 堆和栈
- Java基础
- 即时通讯原理-Instant Messenger
- Android Studio 打包以及获取数字签名
- Android硬件加速
- iOS-Core-Animation-Advanced-Techniques(二)
- 播放系统声音&震动&系统声音对照表