解决方案 »
- googlemap开发 始终出不了地图界面
- Android入门所需java知识
- 能不能定位的时候不导入google地图,从而节省流量呢?
- 求助,如何调试G-Sensor?
- android opencv 编译出错,急!!!!!
- android单文件调试
- 微博登录报错!
- 新手学android 用eclipse创建android项目报错
- android布局
- FFMPEG 在Android 4.0运行的问题,求大神们解决!
- ksoap-android出现expected: START_TAG错误求教
- 程序运行后出现“application settings(in process com.android.settings) is not responding”
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/probardown">
<!-- 设置背景色图像资源 -->
<item android:id="@android:id/background" android:drawable="@drawable/grey" />
<!-- 设置第二级进度条颜色图像资源 -->
<item android:id="@android:id/secondaryProgress" android:drawable="@drawable/grey" />
<!-- 设置第一级进度条颜色图像资源 -->
<item android:id="@android:id/progress" android:drawable="@drawable/green" />
</layer-list>
是不是这个的原因?我用<selector></selector>就可以的。。汗
在哪里用<selector></selector>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="#000" />
<item android:state_focused="true" android:color="#000" />
<item android:state_pressed="true" android:color="#000" />
<item android:color="#fff" />
</selector>
你改下试下。。应该是可以的
<!-- Copyright (C) 2008 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background" >
<shape>
<corners android:radius="5dip" />
<gradient
android:startColor="#ff9d9e9d"
android:centerColor="#ff5a5d5a"
android:centerY="0.75"
android:endColor="#ff747674"
android:angle="270"
/>
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<clip >
<shape>
<corners android:radius="5dip" />
<gradient
android:startColor="#ff9d9e9d"
android:centerColor="#ff5a5d5a"
android:centerY="0.75"
android:endColor="#ff747674"
android:angle="270"
/>
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="5dip" />
<gradient
android:startColor="#ffffd300"
android:centerColor="#ffffb600"
android:centerY="0.75"
android:endColor="#ffffcb00"
android:angle="270"
/>
</shape>
</clip>
</item>
</layer-list>
这是我最后用的
源文件地址http://www.girlcoding.com/2011/04/custom-horizontal-progressbar/#comment-512
例如:
<item android:id="@android:id/background" >
<nine-patch android:src="@drawable/background"> </nine-patch>
</item>
<item android:id="@android:id/progress">
<clip>
<nine-patch android:src="@drawable/progress"> </nine-patch>
</clip>
</item>