【问题标题】:How to create custom seekbar and do optimization?如何创建自定义搜索栏并进行优化?
【发布时间】:2014-09-29 07:16:11
【问题描述】:

我尝试创建一个这样的自定义搜索栏:http://i.stack.imgur.com/8B0Q8.png

但是我遇到了这个问题:http://i.stack.imgur.com/rcQG7.png

我使用这个项目来动态更改文本:github.com/Amit-Gupta26/AndroidCustomSeekBar

我的布局代码在这里:

 <RelativeLayout
 android:id="@+id/layout_seekbar"
 android:layout_width="match_parent"
 android:layout_height="0dp"
 android:layout_weight="1"
 android:background="@drawable/seekbar_bg" >

 <SeekBar
     android:id="@+id/seekbar"
     style="@style/CustomSeekBar"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:layout_alignParentLeft="false"
     android:layout_alignParentTop="false"
     android:layout_centerHorizontal="true"
     android:layout_centerVertical="true" />

我尝试了许多不同的方法。但我无法在所有屏幕上实现稳定性。 怎么会这样?

【问题讨论】:

    标签: android android-custom-view custom-view android-seekbar


    【解决方案1】:

    我认为这篇文章会对你有所帮助:

    Custom Seekbar

    另外你需要使用 9patch 图片

    【讨论】:

      【解决方案2】:

      看了你遇到的问题后,我相信你的问题不是如何创建自定义搜索栏,而是如何单独控制拇指大小和栏大小,比如在不必制作栏或结局那么大,我看你一定要看hereherehere

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-04-02
        • 1970-01-01
        • 2019-12-01
        • 2010-09-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多