微调框,左侧有箭头 [英] Spinner with arrow in left

查看:85
本文介绍了微调框,左侧有箭头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为RTL语言开发一个应用程序,并且想要更改Spinner左侧的箭头位置! 无论如何,没有创建自定义微调器,可以执行此操作吗?

I'm developing an app for RTL language and want to change the position of arrow to the left of Spinner ! Is there anyway to do this without creating a custom spinner ?

推荐答案

您必须编写自定义微调器. 示例代码如下.您可以根据需要进行编辑.

You must write a custom spinner. Sample code is below. You can edit as you wish.

<Spinner
            style="@style/spinner_style"
            android:layout_width="match_parent"
            android:layout_height="wrap content"
             />

@ style/spinner_style:

@style/spinner_style:

 <style name="spinner_style">
    <item name="android:background">@drawable/background_spinner</item>
</style>

@ drawable/background_spinner

@drawable/background_spinner

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item><layer-list>
        <item><shape>
               <solid android:color="@android:color/white" />
                <corners android:radius="4dp" />
                <padding android:left="8dp"/>
            </shape></item>
        <item><bitmap android:gravity="left"
              android:src="@drawable/ic_arrow_drop_down_grey600_36dp"/>                
        </item>
    </layer-list></item>
</selector>

这篇关于微调框,左侧有箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆