Android的搜索栏的变化大小? [英] Change size of Android-Seekbar?

查看:181
本文介绍了Android的搜索栏的变化大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有关于seekbars的问题。
我试过几件事情,但没有任何帮助。
我想改变搜索栏的高度,但不是完整的搜索栏,只有在那里你可以用拇指滚动高出横梁。我试过几件事情例如setBackGroundDrawable和setProgressDrawable,并提出我自己的可绘制,但绘制尺寸固定为标准,Android的搜索栏的大小。
我现在可以做什么?

I have a question concerning seekbars. I tried several things but nothing helped. I want to change the height of the seekbar, but not the complete seekbar, only the bar where you scroll over with your thumb. I tried several things e.g. setBackGroundDrawable and setProgressDrawable and made my own drawables, but the drawable-size is fixed to the size of the Standard-Android-Seekbar. What can I do now?

推荐答案

您必须添加一些填充在各个方向上比设置最小和最大高度。下面是我用一个例子:

You have to add some padding in all directions and than set the min and max height. Here are one example that I used:

<?xml version="1.0" encoding="utf-8"?>
<SeekBar xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:progressDrawable="@drawable/custom_player_seekbar_background"
        android:paddingTop="10px" 
        android:paddingBottom="10px" 
        android:thumb="@drawable/bt_do_player" 
        android:paddingLeft="30px" 
        android:paddingRight="30px" 
        android:minHeight="6dip"
        android:maxHeight="6dip" 
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"/>

这篇关于Android的搜索栏的变化大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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