1.含有EditText的佈局進入,不彈出軟鍵盤
在佈局的父控件添加屬性:
android:focusable="true"
android:focusableInTouchMode="true"
實例:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center_vertical">
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="搜索"/>
</RelativeLayout>
2.解決ScrollView底部有佈局,不能滑動的問題
3.Android中自定義checkbox樣式
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/checkbox_pressed" android:state_checked="true"/>
<item android:drawable="@drawable/checkbox_normal" android:state_checked="false"/>
<item android:drawable="@drawable/checkbox_normal"/>
</selector>
2.在values文件夾下的styles.xml文件中添加CustomCheckboxTheme樣式。<style name="CustomCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox">
<item name="android:button">@drawable/checkbox_style</item>
</style>
3.在佈局文件中使用CustomCheckboxTheme樣式。
<CheckBox
android:id="@+id/cb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/CustomCheckboxTheme" />
都是我遇到的一些小改動,查詢的別人的csdn,然後總結了一下下~