Description:
- When we’re developing, we’re going to use EditText a lot
Can edit box
- If left unchecked, EditText will compete for focus when opened and display input as soon as the user opens the page
- This effect is obviously not in line with a normal need so how to come in
Hide the cursor
? It’s easy. Two lines of code
In an XML file EditText outer frame add android: focusable = “true” android: focusableInTouchMode = “true”
<RelativeLayout
android:id="@+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:paddingBottom="6dp" >
<EditText
android:id="@+id/search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/auto_add"
android:background="@drawable/rounded_edittext"
android:drawableLeft="@drawable/search"
android:ems="10"
android:hint="@string/hint_search"
android:imeOptions="actionSearch"
android:inputType="text"
android:singleLine="true"
android:textSize="15sp" >
</EditText>
Copy the code
Share with you
I want to work my way up
Fly forward on the blades at the highest point
Let the wind blow dry tears and sweat
I want to work my way up
Waiting for the sun to watch its face
Little days have big dreams
I have my day
Let the wind blow dry tears and sweat
One day I will have my day