I have a SeekBar defined in my application as shown below:
<SeekBar
android:id="@+id/seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
I want to place an image beside it that is the same height of the SeekBar. I need to set the height of the image programmatically so that it remains constant across all devices. However I am unable to get the height of the SeekBar.
The code below returns the height of the view and not the SeekBar.
mReadingSeekBar = (ReadingSeekBar) findViewById(R.id.seekbar);
mBarHeight = mReadingSeekBar.getHeight();
And this code doesn't work either. It just returns 0:
mBarHeight = mReadingSeekBar.getProgressDrawable().getMinimumHeight();
Is there a way of finding the actual size of the SeekBar and not just the view size?