Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android - How to set the Rating bar is non clickable and touchable in HTC mobile

My application have rating bars. I want to set the Rating bar is non-click able and no-touchable. For this i added the following code in xml file of each rating bar.

It is working in samsung galaxy Apollo GT-i5801. But it is not working in the HTC mobile. Why?

xml code

android:clickable="false"      android:focusableInTouchMode="false"     android:focusable="false" 

thanks

like image 910
naresh Avatar asked Aug 22 '11 11:08

naresh


People also ask

How do I turn off rating bars?

android:attr/ratingBarStyleSmall" or scaleX/scaleY the click interaction with RatingBar is disabled. This works for me. Hope this helps you!

What is rating bar in Android?

android.widget.RatingBar. A RatingBar is an extension of SeekBar and ProgressBar that shows a rating in stars. The user can touch/drag or use arrow keys to set the rating when using the default size RatingBar.


2 Answers

You could also set the RatingBar as indicator from the xml with the following:

android:isIndicator="true" 
like image 190
Andy Avatar answered Sep 30 '22 19:09

Andy


This is it write this code in your setOnRatingBarChangeListener

ratingaddrate.setIsIndicator(true); 

Update :

You can use this example in your XML

android:isIndicator="true" 

also add this line to the Code

ratingBar.setFocusable(false); 
like image 23
alireza amini Avatar answered Sep 30 '22 20:09

alireza amini