progressBar的secondaryProgress和progress怎么不起作用
progressBar的secondaryProgress和progress怎么不起作用,还有secondary就那个浅色的进度条怎么不显示?求大神!!!下面是MainActivity.java文件package com.himi;
import android.app.Activity;import android.os.Bundle;import android.widget.SeekBar;import android.widget.TextView;import android.widget.SeekBar.OnSeekBarChangeListener;
public class MainActivity extends Activity {private SeekBar seekBar;private TextView tv;
@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);seekBar = (SeekBar) findViewById(R.id.seekbar);tv = (TextView) findViewById(R.id.tv);seekBar.setSecondaryProgress(20);seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {//当用户对拖动条的拖动的动作完成时触发//@Overridepublic void onStopTrackingTouch(SeekBar seekBar) {tv.setText("<拖动条>完成拖动"); }//当用户对拖动条进行拖动时触发//@Overridepublic void onStartTrackingTouch(SeekBar seekBar) {tv.setText("<拖动条>拖动中..."); }//当拖动条的值发生改变的时触发//@Overridepublic void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {tv.setText("当前<拖动条>的值为:"+progress);}});}}
还有main.xml文件:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="默认进度条:" /> <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="progress1" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="小圆形进度条:" /> <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="progress3" style="?android:attr/progressBarStyleSmall" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="大圆形进度条:" android:layout_gravity="center_vertical" /> <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="progress3" style="?android:attr/progressBarStyleLarge" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="条形进度条:" android:id="@+id/tv" /> <ProgressBar android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="progress2" android:id="@+id/porb" style="?android:attr/progressBarStyleHorizontal" android:max="100" android:progress="80" android:secondaryProgress="0" /> </LinearLayout> android progressbar
补充:Java , Eclipse