【发布时间】:2014-03-28 12:52:26
【问题描述】:
我有一个简单的表单,其中包含两个带有斜体样式字体的 editText,但是当放置在第一个位置时,一些字母(p 和 j)在左侧被“剪切”了。我试图用drawablePadding修复它,但它不起作用。在我的情况下,在第一个字母之前插入一个空格不是一个解决方案,至少不是最好的,因为第二个表单字段是一个密码,所以由于空格字符,一个点会自动显示给用户。 EditText 的代码如下:
<EditText
android:id="@+id/edit_txt_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/rectangle_white"
android:drawableLeft="@drawable/ic_mail"
android:drawablePadding="10dp"
android:ems="10"
android:hint="@string/login_email_placeholder"
android:imeOptions="actionNext"
android:inputType="textEmailAddress"
android:padding="10dp"
android:textColor="@color/black"
android:textCursorDrawable="@null"
android:textColorHint="@color/color_form_login_text"
android:textSize="17sp" >
活动中:
Typeface edit_text_font = Typeface.createFromAsset(getActivity().getAssets(),
"fonts/helvetica-bold-italic.ttf");
//Set Fonts
mEditTxtLogin.setTypeface(edit_text_font);
错误图片:
解决办法是什么?
【问题讨论】:
-
@nomada 你能在下面看到我的回答吗
-
删除 em 不起作用
标签: android android-layout android-edittext android-fonts