在onCreate函数中:
mLinearlayout= new LinearLayout(this);
mLinearlayout.setOrientation(LinearLayout.VERTICAL);
mTextview= new
TextView(this);
mTextview.setText("MASK");
mLinearlayout.addView(mTextview);
mIV = new
MyImageView(this);
mLinearlayout.addView(mIV);
setContentView(mLinearlayout);