android EditText: hint disappears with inputType=“textCapCharacters”

reotenrelen

New Member
This might be a bug or I just don't get why, but it seems that setting \[code\]inputType="textCapCharacters"\[/code\] (or any other inputType) on a \[code\]EditText\[/code\] makes disappearing the hint in combination with \[code\]gravity="center"\[/code\].The following is an extract of my xml where the \[code\]LinearLayout\[/code\] visible on the Image below is defined:a) Without \[code\]inputType="textCapCharacters"\[/code\]\[code\](...)<LinearLayout android:id="@+id/lin_cond1" android:layout_below="@id/v_cond_line1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:orientation="horizontal"> <RadioButton android:id="@+id/rb_cond_stake_normal" android:layout_width="0dp" android:layout_weight="15" android:layout_height="wrap_content" /> <TextView android:layout_width="0dp" android:layout_weight="25" android:layout_height="wrap_content" android:text="@string/define_stake" /> <EditText android:id="@+id/et_cond_enter_stake_normal" android:layout_width="0dp" android:layout_weight="20" android:layout_height="wrap_content" android:inputType="number" android:gravity="center" /> <EditText android:id="@+id/et_cond_currencies" android:layout_width="0dp" android:layout_weight="40" android:layout_height="wrap_content" android:maxLength="3" android:gravity="center" android:hint="@string/currency" /></LinearLayout>(...)\[/code\]Result
B24Eu.png
b) With \[code\]inputType="textCapCharacters"\[/code\]\[code\](...)<LinearLayout android:id="@+id/lin_cond1" android:layout_below="@id/v_cond_line1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:orientation="horizontal"> <RadioButton android:id="@+id/rb_cond_stake_normal" android:layout_width="0dp" android:layout_weight="15" android:layout_height="wrap_content" /> <TextView android:layout_width="0dp" android:layout_weight="25" android:layout_height="wrap_content" android:text="@string/define_stake" /> <EditText android:id="@+id/et_cond_enter_stake_normal" android:layout_width="0dp" android:layout_weight="20" android:layout_height="wrap_content" android:inputType="number" android:gravity="center" /> <EditText android:id="@+id/et_cond_currencies" android:layout_width="0dp" android:layout_weight="40" android:layout_height="wrap_content" android:inputType="textCapCharacters" android:maxLength="3" android:gravity="center" android:hint="@string/currency" /></LinearLayout>(...)\[/code\]Result
tyRnN.png
What I tried and didn't worked:
- making the hint text also in capitals
- putting \[code\]inputType="textCapCharacters"\[/code\] at different positionsWhat works, but Is not desired:
- (as seen around here) remove \[code\]gravity="center"\[/code\]. But why does it not work only in combination? Leaving the \[code\]gravity\[/code\] without the \[code\]inputType\[/code\] works normal.So is there any solution to have either a inputType and the gravity?
 
Back
Top