Android碎片知识

来源:互联网 发布:手机桌面图标整理软件 编辑:程序博客网 时间:2024/06/10 04:16
1.空格占位符对齐
  == 普通的英文半角空格
  ==   ==   == no-break space (普通的英文半角空格但不换行)
  == 中文全角空格 (一个中文宽度)
  ==   == en空格 (半个中文宽度)
  ==   == em空格 (一个中文宽度)
  == 四分之一em空格 (四分之一中文宽度)

2.Android ScrollView自动滑动一段距离的问题解决
问题出现的原因是因为ScrollView中子布局的的焦点的变化导致ScrollView自动的滑动 。所以解决方法就是让ScrollView中的最外层子布局焦点固定。
<ScrollView        android:id="@+id/scrollView1"        android:layout_width="match_parent"        android:layout_height="match_parent" >        <LinearLayout            android:layout_width="match_parent"            android:layout_height="match_parent"            android:orientation="vertical"            android:focusable="true"            android:focusableInTouchMode="true">        </LinearLayout></ScrollView>
在LinearLayout中加入 
Android:focusable=”true” 
android:focusableInTouchMode=”true” 

3.Button的内容为英文时会自动转化为大写
android:textAllCaps="false"  默认是true 改为false即原样输出为输入的字体

原创粉丝点击