0
 public View getView(int position, View convertView, ViewGroup parent) {
         LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
         View grid=inflater.inflate(R.layout.griditem, parent, false);
         imageView=(ImageView)grid.findViewById(R.id.grid_prod);
         imageView.setImageResource(imgId[position]);
         imgoff =(ImageView)grid.findViewById(R.id.offer);
         tv=(TextView)grid.findViewById(R.id.grid_text);
         tv.setText(namesArr[position]);
         tv.setTextColor(Color.BLACK);
        rb=(RatingBar)findViewById(R.id.grid_rating);
         rb.setRating(rateFArr[position]);
            return grid;
        }

ここで setRating を使用すると、アプリケーションが強制的に閉じられる GridView に評価バーを挿入します。これrateFArr[]はフロート配列であり、ここに値を出力すると儀式が行われます。それでも、評価バーに設定してもうまくいきません。

Plzは、事前に感謝してこれを修正するのを手伝ってくれます.

4

1 に答える 1