因此,在随附的屏幕截图和代码示例中,您可以看到我的自定义微调器。正如你所看到的,无论我尝试做什么,我的文字都会被切断。九个补丁图像设置正确,其上也有文本填充。我几乎拥有一切权利,却完全不知所措......
定制旋转器
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/spinner"
android:textColor="#555"
android:textSize="22sp"
android:textStyle="bold"
android:typeface="normal"
android:layout_width="wrap_content"
android:layout_height="40sp"
android:gravity="center_vertical|left"
android:singleLine="true" />
实现自定义微调器
<Spinner
android:id="@+id/spinner_both20"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/b_both20"
android:layout_alignTop="@+id/b_both20"
android:layout_marginLeft="4sp"
android:layout_marginRight="5sp"
android:layout_toRightOf="@+id/b_both20"
android:background="@drawable/buttons"
android:padding="20sp" />
Java
ArrayAdapter<CharSequence> aBoth = ArrayAdapter
.createFromResource(getActivity().getApplicationContext(),
R.array.d20both, R.layout.spinner_settings)
我对在如此简单的事情上花费这么多时间感到非常沮丧。任何帮助都会摇滚!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)