Question

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?

Was it helpful?

Solution

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"))

OTHER TIPS

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);
            }
        });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top