android edittext设置paddingLeft无效
<RelativeLayout
android:id="@+id/login_email_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/login_launcher" >
<EditText
android:id="@+id/login_edit_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:background="@drawable/login_email_bg_normal"
android:gravity="center_vertical"
android:hint="@string/login_user_hint"
android:minHeight="40dp"
android:paddingBottom="2dp"
android:paddingLeft="35dp"
android:paddingRight="26dp"
android:paddingTop="1dp"
android:textColor="@color/text_dark"
android:textColorHint="@color/text_hint"
android:textSize="15sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="50dp"
android:src="@drawable/login_email" />
</RelativeLayout>
eclipse 里面可以,android studio里面就有问题了。
麻烦大家帮我看一下!
兰迪斯丨翔
10 years ago
Answers
<EditText
android:id="@+id/login_edit_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:background="@drawable/login_email_bg_normal"
android:gravity="center_vertical"
android:hint="@string/login_user_hint"
android:minHeight="40dp"
android:paddingBottom="2dp"
android:paddingLeft="35dp"
android:paddingRight="26dp"
android:paddingTop="1dp"
android:drawableLeft="@drawable/search_icon"
android:textColor="@color/text_dark"
android:textColorHint="@color/text_hint"
android:textSize="15sp" />
wokaka
answered 10 years ago