
我有一个定义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文本不是垂直居中的所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)