Problem:
Okay. So I was trying to make a temperature control app for a college assignment and wanted create a vertical Seek Bar. This is the method I found to set a vertical seekbar in XML.By default a seek bar is horizontal but if you add the following line of code in XML, it can become vertical.
android:rotation="270"Unfortunately this works only if you are working with API 11 or higher. For lower APIs, I still haven't found a solution yet. Let me Know if you find any solution.
Solution:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:rotation="270"
/>
</RelativeLayout>
0 comments:
Post a Comment