2014-01-13 60 views
0

我想爲輪式選取器添加標題。我找不到任何標題的方法。我已經有一個只用java編寫的輪子選取器。我只想在java.Please中添加標題請幫助我。我可以給輪式選取器添加標題

編輯:這是我的代碼。

final WheelView minute = new WheelView(Mcontex); 
    minute.setMinimumHeight(300); 
    layoutHome.addView(minute, new LayoutParams(
      android.view.ViewGroup.LayoutParams.WRAP_CONTENT, 
      android.view.ViewGroup.LayoutParams.WRAP_CONTENT, 1.2f)); 
    layoutmain.addView(layoutHome); 
    minute.setViewAdapter(new RotationArrayAdapter(context, minutesArray, 1)); 
    minute.setCurrentItem(0); 
    minute.addChangingListener(listener); 
+1

ü談論這輪選擇器[R呢?還請顯示一些代碼 – Dev01

+0

我編輯了我的代碼。 – Halo

+0

你可以從鏈接中獲得幫助http://stackoverflow.com/questions/24833827/wheel-picker-on-dialog-box-android/24897583#24897583 – snj

回答

0

,您可以嘗試:

String[] dayArray = {"2 JAN", "3 jan", "4 jan", "5 jan", "6 jan", "7 jan", "8 jan"}; 
    WheelView day; 

    day = (WheelView) findViewById(R.id.day); 
      day.setViewAdapter(new DayArrayAdapter(MainActivity.this, dayArray, weekDay)); 


      day.addChangingListener(new OnWheelChangedListener() { 

       @Override 
       public void onChanged(WheelView wheel, int oldValue, int newValue) { 

        Log.e("onChanged hours", dayArray[newValue]); 

        mCustomDate = dayArray[newValue]; 
        mFinalTime = mCustomDate+" "+mCustomHour+mCustomMinute+" "+mAMORPM; 
        mSeletedDateTextView.setText(mFinalTime); 
       } 
      }); 
+0

我不清楚mCustomHour,mCustomMinute,mAMORPM。然後,你能告訴我輸出。 :) – Halo

+0

兄弟從以下鏈接獲取示例:https://www.dropbox.com/s/92l4efwq6g40wpk/DatePicker.tar.gz –

相關問題