android - Custom RatingBar doesn't work on Dialog -
i have set custom ratingbar style
inside style.xml code:
<item name="android:ratingbarstyle">@style/ratingbarstyle</item> <style name="ratingbarstyle" parent="android:widget.ratingbar"> <item name="android:progressdrawable">@drawable/ratingbar</item> <item name="android:minheight">13dip</item> <item name="android:maxheight">13dip</item> </style>
now have created custom layout dialog (xml) [is inside relativelayout]:
<ratingbar android:id="@+id/custom_dialog_vota_ratingbar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/custom_dialog_vota_label_ratingbar" android:layout_below="@+id/custom_dialog_vota_label_ratingbar" android:layout_margintop="2dp" android:max="5" android:numstars="5" android:stepsize="0.5" />
and on class have code:
public void onclick(view view) { final dialog dialog = new dialog(mcontext); dialog.setcontentview(r.layout.custom_dialog_vota); dialog.settitle("vota"); string t = ((textview)dialog.findviewbyid(r.id.custom_dialog_vota_label_ratingbar)).gettext().tostring(); ((textview)dialog.findviewbyid(r.id.custom_dialog_vota_label_ratingbar)).settext(t + nome_book); dialog.show(); }
now ratingbar works fine everywhere, on dialog doesn't work , have no idea why..
please me
edit don't know why doesn't work on emulator on preview in ide totally works!
edit2 result:
how can see custom ratingbar works on listview or on other activity this:
but on dialog doesn't, , tried upload device, still nothing..
sorry "blur" can't show (working in office) wip app..
if use alertdialogbuilder can set style xml resource dialog. can use layoutinflator inflate custom view , call setview on builder
Comments
Post a Comment