他の要素を持つ RelativeLayout の上にある動的な位置に画像を描画しようとしています。View を拡張してこのビューを RelativeLayout に追加するクラスを作成しようとしましたが、画面に表示されるのは画像だけです。RelativeLayout の他の要素は表示されません。
これはビュークラスです
@Override
protected void onDraw (Canvas canvas) {
super.onDraw(canvas);
Bitmap myBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
canvas.drawColor(Color.BLACK);
canvas.drawBitmap(myBitmap, 50,50, null);
}
これはアクティビティの onCreate にあります
mainLayout = (RelativeLayout)findViewById(R.id.main_tutorial_layout);
mainLayout.addView( new DrawAnimationTutotial(getApplicationContext()));
mainLayout.invalidate();