안드로이드 개발 질문/답변
(글 수 45,052)
public class NosunShow extends Activity {
private Bitmap bit=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
LayoutParams lp= new LayoutParams(926, 567); 이부분에서 어떻게 하면될꺼 같은데 잘 안풀리네요 도와주세요
NosunView nv = new NosunView(this, null);
ScrollView sv = new ScrollView(this);
LinearLayout lo= new LinearLayout(this);
nv.setLayoutParams(lp);
lo.addView(nv, lp);
sv.addView(lo, lp);
sv.getMaxScrollAmount();
setContentView(sv);
}
public class NosunView extends ImageView {
public NosunView(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
super.onDraw(canvas);
canvas.drawColor(Color.WHITE);
Resources r = getResources();
BitmapDrawable bd= (BitmapDrawable)r.getDrawable(R.drawable.nosu);
bit = bd.getBitmap();
canvas.drawBitmap(bit, null, new Rect(0, 0, 926 , 567), null);
}
}
}



