色の設定 背景色の設定 imageview
// Resourceを設定
ImageView imgView1 = (ImageView)findViewById(R.id.imgview1_id);
imgView1.setImageResource(R.drawable.photo);
// Bitmapを設定
ImageView imgView2 = (ImageView)findViewById(R.id.imgview2_id);
imgView2.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.photo));
// Drawableを設定
ImageView imgView3 = (ImageView)findViewById(R.id.imgview3_id);
imgView3.setImageDrawable(getResources().getDrawable(R.drawable.photo));
Book book = adapter.getItem(position);
TextView griddd = (TextView)view.findViewById(R.id.griddd);
griddd.setBackgroundColor(Color.parseColor("#50000000"));
//Book user = adapter.getItem(position);
LinearLayout ll = (LinearLayout)view.findViewById(R.id.grid99);
ll.setBackgroundColor(Color.parseColor("#ff0000"));
view. が this になると、結果が違うのに注意
ライナーレイアウトの背景色の設定方法・・・わからない! (コード)
<LinearLayoutもview だった!
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/liner1"
android:orientation="vertical" >
LinearLayout ll = (LinearLayout)findViewById(R.id.liner1);
ll.settBackgroundColor(Color.parseColor("#ff0000"));
//////////////////textview の背景色
TextView tv_day = (TextView)view.findViewById(R.id.listtv_day);
tv_day.setBackgroundColor(Color.RED);について
#AARRGGBBの時
tv_day.setBackgroundColor(Color.parseColor("#50FF0000"));
tvdd.setTextColor(Color.parseColor("#ff0000"));
/////////////////背景に画像を挿入
view.setBackgroundResource(R.drawable.testblue);
//Listviewの1行に
view.setBackgroundColor(Color.parseColor("#50FF0000"));