Android EditText文本不是垂直居中的

Android EditText文本不是垂直居中的,第1张

概述我有一个定义EditBox的搜索栏<EditTextandroid:id="@+id/search_editbox"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_centerVertical="true"android:layout_toLef

我有一个定义EditBox的搜索栏

<EditText    androID:ID="@+ID/search_editBox"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:layout_centerVertical="true"    androID:layout_toleftOf="@ID/search_execute_imagevIEw"    androID:layout_toRightOf="@ID/layout_back_logo"    androID:gravity="left"    androID:hint="@string/search_hint"    androID:maxLength="20"    androID:textCursorDrawable="@null"    androID:drawableRight="@drawable/abc_ic_clear_holo_light"    androID:background="@drawable/rounded_edittext_states"    androID:padding="5dip"            androID:singleline="true"    androID:textSize="@dimen/main_text_size" />

尽管androID:layout_centerVertical =“true”,但文本不在中间,而是靠近上侧.

解决方法:

使用

 androID:gravity="left|center_vertical"
总结

以上是内存溢出为你收集整理的Android EditText文本不是垂直居中的全部内容,希望文章能够帮你解决Android EditText文本不是垂直居中的所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1114892.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存