0
我有一個自定義對話框,應該在按下android星級評估者控件時啓動,但沒有任何對話框打開。自定義對話框將不會打開
XML的星級評定者:
<RatingBar
android:id="@+id/beerRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
android:stepSize="1.0"
android:rating="0"
style="?android:attr/ratingBarStyleSmall"
android:clickable="true"
android:onClick="rateDialog"
/>
推出對話框的方法是:
public void rateDialog(View v){
// custom dialog
dialog = new Dialog(this);
dialog.setContentView(R.layout.rate_stars);
dialog.setTitle("Rate this Beer");
}
再次,單擊小ratebar打開不打開對話框的對話框。