I'm using Custom ListView with Edittext.
My problem is, while i'm typing in EditText , the Keypad does not show the Suggestion layout which is in Top of the Keypad.
my EditText code as,
<EditText
android:id="#+id/remarks_eT"
android:layout_width="match_parent"
android:layout_height="150dp"
android:background="#drawable/remarks_bg"
android:gravity="left"
android:maxLength="450"
android:inputType="text|textMultiLine"
android:textCursorDrawable="#null"
android:textColor="#color/app_primary_color"
android:textColorHint="#color/app_primary_color"
android:hint="Type your Remarks"/>
How can i resolve this annoying issue.?
You can enable auto suggestion for edit text by adding this line
emailET.setInputType(InputType.TYPE_CLASS_TEXT);
in java file and adding
android:autoText="true"
in xml although autoText is depreciated now, you can have nice suggestion on it by android studio :)
Related
I have the following edit text
<EditText
android:id="#+id/txtMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:gravity="start"
android:inputType="text|textMultiLine"
android:minHeight="90dp"
android:singleLine="false"
android:textColor="#color/textColor" />
Every reference shows that the code is correct and in fact the text wraps to multiline. But the enter key doesn't go to the new line when i use swiftkey keyboard (Google keyboard works fine)
any idea of how to solve this issue ?
Thanks
Have you considered switching to the default keyboard. It might solve your issue.
See this answer Set EditText to be Multiline(Enter is carrige return) and not display suggestions for more details.
I am using a edittext with multiline property.when i type any word there is no underline but as i used space or enter key all the text cover by underline .how it can be remove . I dont want to see underline .so please give me any solution..
my xml file is......
<EditText
android:layout_centerInParent="true"
android:id="#+id/etext"
android:layout_width="130dp"
android:layout_height="wrap_content"
android:visibility="invisible"
android:textSize="20dp"
android:background="#null"/>
I suppose you mean underlines that come with auto-suggestions.
If you don't want them, try this
android:inputType="textNoSuggestions"
in your EditText xml.
I have this EditText
<EditText
android:layout_width="match_parent"
android:layout_height="72dp"
android:hint="#string/write_message"
android:textColorHint="#color/primary_color"
android:ems="10"
android:imeOptions="actionDone"
android:inputType="textImeMultiLine"
android:id="#+id/message_input"
android:layout_gravity="center_horizontal"
android:backgroundTint="#color/primary_color"/>
When the box is filled up with user inputted text, it scrolls to the right to make room for more text, I do not like this behavior, and would prefer it if the EditText box expanded upwards when it needs more room? Is there a way to do this? Thanks.
Yes, this actually involves two things:
Making the EditText accept multi-line input.
Having its height grow as more text lines are added.
Therefore, to achieve this, you need to set up:
android:inputType="textMultiLine"
android:layout_height="wrap_content"
(Be mindful of the difference between textMultiLine and textImeMultiLine).
The full XML snippet would be:
<EditText
android:layout_width="match_parent"
android:inputType="textMultiLine"
android:layout_height="wrap_content"
android:hint="#string/write_message"
android:textColorHint="#color/primary_color"
android:ems="10"
android:imeOptions="actionDone"
android:id="#+id/message_input"
android:layout_gravity="center_horizontal"
android:backgroundTint="#color/primary_color"/>
Use both flags: textMultiLine will wrap your input, and textImeMultiLine will provide a break-line key in your keyboard.
<EditText
...
android:layout_height="wrap_content"
android:inputType="textImeMultiLine|textMultiLine"
... />
In my case I have multiline text, but it showed one line and a keyboard:
Though I have already set android:inputType="textCapSentences|textAutoCorrect|textMultiLine", it didn't help. Then I understood that when the keyboard appears in DialogFragment, it collapses the EditText. See DialogFragment and force to show keyboard to show keyboard when DialogFragment shows.
Then I added a short delay (100-300 ms) before showing the keyboard. Now I have:
In AndroidManifest I set android:windowSoftInputMode="adjustResize" for current activity.
I'm trying to define an EditText but this warning is shown:
This text field does not specify an inputType or a hint.
The code in main.xml is:
<EditText android:id="#+id/input"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/textTest" />
How can I fix it?
You could add a hint :
android:hint="This will appear to the user if he didn't enter something yet in the EditText"
and a inputType so you could present to the user a better suited soft keyboard for the text he is suposed to enter in the EditText:
android:inputType="number"
will present a soft keyboard with only numbers and various signs.
Those are just warnings, you could ignore them but is better for the user to implement them.
<EditText
android:id="#+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
>
I think You should add input type.......
This is a known issue. Sometimes it doest work with changing to:
android:inputType="text"
I got it to work by setting:
android:inputType="textNoSuggestions"
Hope this helps
Above all are the solutions but before that you should understand what does that warnig mean.
Hint:- Hint is the text shown to user before writing anything over.
For eg. if you are putting a edittext where you want user to add his
name then you can write
<Edittext
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:hint="Enter Name"/>
Input Type:- This is the xml tag that is to be used within edittext to let edittext to follow that particular restriction. if you are giving inputtype:number then user would be able to enter only numbers. There are several input type fields are there for that you can refer official developer site.
I tried to show a hint in the EditText of my form, but i can't see that hint that i have set in the XML Layout while my application gets deployed, but i can able see the hint in eclipse designer view, but while getting deployed the same hint suppose to appear is missing, i tried with all the possible ways still i could not get the hint in the EditText... This is one of the Edit Text layout that i have used..
<EditText android:id="#+id/SetTimerSec_EditText01"
android:layout_width="60sp"
android:layout_height="40sp"
android:singleLine="true"
android:layout_x="220sp"
android:layout_y="170sp"
android:hint="0"
android:inputType="phone"
android:textColorHint="#color/black"
android:gravity="center"
android:focusableInTouchMode="true" />
[link text][1]
Can anybody Help me..Please
Thanks in advance
[1]: http://imgur.com/PzomF.jpg
[ScreenShot of Designer View with hint displayed][1]
It seems like a SDK bug, or at least related to one.
http://code.google.com/p/android/issues/detail?id=7252
The hint shows up if you remove the following:
android:gravity="center"
add android:ellipsize="start" and your hint will show up and be centered!