문제

I'm using the WheelView( http://code.google.com/p/android-wheel/ ) to let users input a number of a certain unit (e.g. kg). I'd like to display the unit of the current value next to it like it is shown in this picture.

WheelView with caption "hour"

Sadly, the WheelView doesn't support labelling (anymore). Any idea how I can implement this?

도움이 되었습니까?

해결책

i know this is not exactly what you want, but the closest thing to it, and it can be done easily. you could include your tag in the format string, like this:

wheelView.setViewAdapter(new NumericWheelAdapter(getActivity(), 0, 23, "%02d hour"))

다른 팁

You can try it:

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);
            }
        });
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top