如何创建这种类型的纹理进度条“line-diag”(ninepatch?)?如何创建这种类型的纹理进度条“line-diag”(ninepatch?)?
我看过一些线程,我认为解决办法是使用类型9补丁的图像。但我不明白如何做对。你能解释我怎么能做出这个进度条吗?
如何创建这种类型的纹理进度条“line-diag”(ninepatch?)?如何创建这种类型的纹理进度条“line-diag”(ninepatch?)?
我看过一些线程,我认为解决办法是使用类型9补丁的图像。但我不明白如何做对。你能解释我怎么能做出这个进度条吗?
我不认为你需要9补丁在这里。只需动态改变个够条的宽度(我猜那是鲜红色的),并设置适当的scaleType
.-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bar_dark" />
<ImageView
android:layout_width="200dp"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:src="@drawable/bar_light" />
</RelativeLayout>
对于ProgressBar
组件,这个帖子可以help.-
无需9补丁。您可以使用自定义XML drawable。下面是一个很好的教程:Android Tutorials for Beginners
Google“android custom progress bar”for more examples。
这里的进展在哪里? – pskink
下面的图片(红色) – ephramd