作者gene07 (-.-)
看板AndroidDev
标题[问题] 自制SeekBar进度条显示问题
时间Tue Nov 29 14:33:03 2016
是这样的我在layout.xml中seekbar的progressdrawable中设置一个特定的颜色如下
<item android:id="@android:id/progress" >
<clip android:clipOrientation="horizontal" android:gravity="left" >
<inset
android:insetBottom="5px"
android:insetTop="5px">
<shape>
<gradient
android:startColor="#303F9F"
android:centerColor="#00EC00"
android:centerX="0.5"
android:endColor="#BB3D00"
android:angle="0"
/>
</shape>
</inset>
</clip>
</item>
而在MainActivity我可能会动态修改到inset的位置
所以我写了
InsetDrawable ID = new InsetDrawable(getDrawable(R.drawable.choose),0,3,0,3);
之後把ID放到seekbar.setProgressDrawable(ID);
把apk安装到手机後我看seekbar的progress那列都没有显示我需要的颜色。
只有用手去拉thumb才会出现我所设定的东西...
想请问是为什麽...
我在.xml中也有设定progress的初始位置..
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 60.250.82.82
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/AndroidDev/M.1480401187.A.490.html