问题
Is it possible to use more then 1 imeOptions
in Android xml ? for the same text field
.
e.g.
<EditText
android:id="@+id/mywriting"
android:imeOptions="actionDone"
android:imeOptions="autoText"/>
Right now it is giving me an error, saying 1 imeOptions has already been used
and I can't use any more
回答1:
Use | to combine, like that:
android:imeOptions="actionDone|actionNext"
In your case, the problem is with autoText, which is not a valid value for imeOptions
.
回答2:
<EditText
android:id="@+id/mywriting"
android:imeOptions="actionDone|autoText" />
ERRATUM
My bad.
It is the inputType
not the imeOptions
that can be combined.
<EditText
android:id="@+id/mywriting"
android:inputType="..."
android:imeOptions="actionDone" />
来源:https://stackoverflow.com/questions/27295749/how-to-use-more-then-one-imeoptions-in-android