调整大小在Android上的微调过程中的问题 [英] Problems during Resize the spinner in Android
本文介绍了调整大小在Android上的微调过程中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Android应用程序使用的一个定制微调。
我的编码本: -
I used one customize spinner in my Android application. My Coding for this:-
<Spinner
android:id="@+id/phone2_spinner"
android:layout_width="60"
android:layout_height="45"
android:background="@drawable/spinner_phone"
android:gravity="center"
android:spinnerMode="dropdown"
android:layout_marginTop="3"
android:layout_marginRight="2"
/>
和这棵摇钱树我创建一个TextView
and for this spinner i created a TextView
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:ems="3"
android:gravity="center"
android:textColor="@color/spinner_text_color"
android:textSize="16sp" />
现在它看起来像这样
和编码为Android:背景=@绘制/ spinner_phone是
and coding for the android:background="@drawable/spinner_phone" is
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<stroke
android:width="@dimen/shape_stroke_width"
android:color="@color/stroke_color" />
<solid android:color="@color/white" />
</shape>
我要重新大小的一半的微调,但我想元素的大小,因为它是,如果我减少文本视图,然后微调的元素是相互重叠的大小。
看起来像这样重复的部分:结果
请帮我。
推荐答案
这样做的主要原因是因为你的的TextView
没有了minHeight
,那么我可以建议是加入这个属性。如果你感觉很舒服,然后尝试给我的地方了 18dp
不同的值。你的的TextView
看起来像这样
The main cause of this is because your TextView
doesn't have minHeight
, So what I can suggest is to add this attribute. If you feel comfortable, then try giving different values where I gave 18dp
. Your TextView
looks like this
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:minHeight="18dp"
android:ems="3"
android:gravity="center"
android:textColor="@color/spinner_text_color"
android:textSize="16sp" />
这篇关于调整大小在Android上的微调过程中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文