如果我在editext中更改文本大小,则edittext的高度会相应更改.我希望edittext的大小相同,我想要一个较小的提示或文本.我该怎么办?以下是代码,我也发布了这个布局的截图:
<RelativeLayout
android:id="@+id/normal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#4594e4"
android:orientation="horizontal">
<ImageView
android:id="@+id/set"
android:layout_width="wrap_content"
android:layout_height="75dp"
android:layout_marginTop="05dp"
android:padding="5dp"
android:src="@drawable/bari" />
<EditText
android:id="@+id/etOrigin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/_35sdp"
android:layout_marginTop="@dimen/_10sdp"
android:layout_toEndOf="@+id/set"
android:layout_toRightOf="@+id/set"
android:background="#5fa7f1"
android:inputType="textPersonName"
android:text="My Location"
android:textColor="#434343"
android:textIsSelectable="true" />
<EditText
android:id="@+id/etDestination"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/etOrigin"
android:layout_marginRight="@dimen/_35sdp"
android:layout_marginTop="@dimen/_5sdp"
android:layout_toEndOf="@+id/set"
android:layout_toRightOf="@+id/set"
android:background="#5fa7f1"
android:inputType="textPersonName"
android:onClick="wow"
android:text="Where to go ?"
android:textColor="#fff"
android:textColorHint="#fff" />
<ImageView
android:id="@+id/swipe"
android:layout_width="30dp"
android:layout_height="27dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/_5sdp"
android:background="@drawable/flip" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
更改前布局的屏幕截图:

更改文本大小后的布局屏幕截图:
