【问题标题】:I need the seekbar thumb in center of seekbar height我需要在搜索栏高度中心的搜索栏拇指
【发布时间】:2012-11-30 14:09:31
【问题描述】:

我在我的应用程序中使用了一个搜索栏,并设置了一个自定义可绘制对象(形状)来设置拇指。

以下是我的 drawable(seekbar_circle_normal.xml) 代码 sn-p :

<item>
    <shape android:shape="rectangle" >
        <solid android:color="#FDC300" />
        <size
            android:height="16dp"
            android:width="16dp" />
        <padding 
            />
        <corners
            android:bottomLeftRadius="23dp"
            android:bottomRightRadius="23dp"
            android:topLeftRadius="23dp"
            android:topRightRadius="23dp" />
    </shape>
</item>
 <item>
    <shape android:shape="rectangle" >
        <corners
            android:bottomLeftRadius="23dp"
            android:bottomRightRadius="23dp"
            android:topLeftRadius="23dp"
            android:topRightRadius="23dp" />
        <gradient
            android:angle="270"
            android:endColor="#33B7E7"
            android:gradientRadius="1"
            android:startColor="#33B7E7" >
        </gradient>
        <size
            android:height="3dp"
            android:width="3dp" />
        <stroke
            android:width="0.5dp"
            android:color="#1DA6AE" />
    </shape>
</item> 

我的xml文件代码如下:

我想在搜索栏的中心显示拇指。我怎么能证明这一点。

提前致谢。

【问题讨论】:

标签: android


【解决方案1】:

您可以在this 找到答案。 你需要设置 android:maxHeight 和 android:minHeight 相同。例如

android:maxHeight="3dp"
android:minHeight="3dp"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-30
    • 1970-01-01
    • 2015-09-12
    相关资源
    最近更新 更多