我應該如何設置評分欄至false
的可編輯屬性? 我嘗試以下,但它不工作:如何設置評分欄的可編輯屬性爲false
holder.rb=(RatingBar)convertView.findViewById(R.id.ratingBar1);
holder.rb.setActivated(false);
我應該如何設置評分欄至false
的可編輯屬性? 我嘗試以下,但它不工作:如何設置評分欄的可編輯屬性爲false
holder.rb=(RatingBar)convertView.findViewById(R.id.ratingBar1);
holder.rb.setActivated(false);
要disactivate視圖使用:
holder.rb=(RatingBar)convertView.findViewById(R.id.ratingBar1);
holder.rb.setEnable(false)
儘量holder.rb.setEnabled(false);
或holder.rb.setIsIndicator(true);
來代替。 他們都會工作。
試試這個在您的XML:android:isIndicator="true"
或這在Java中:holder.rb.setIsIndicator(true);
我想你想你的評價欄是用戶不變。如果是使用我上面提到的代碼。 但是,如果您只是想啓用或禁用您的評級欄,您可以使用此行:
holder.rb.setEnabled(false);
謝謝你幫助我.iam初學者在android – 2015-02-10 06:55:07
@AvaisShaikh:你的歡迎;) – 2015-02-10 06:59:13
您的意思是激活和停用? 'holder.rb.setEnable(false)' – 2015-02-09 10:24:56