안녕하세요, 개발 초보자입니다.
카메라 프리뷰 위에 버튼이 아니고 반투명상태로 이미지를 올려놓고 싶습니다.
(마치 증강현실처럼..하지만 아이콘들이 아닌 한장의 back_pattern2.png 파일)
layout은 RelativeLayout 으로 잡았는데,
addView를 해도 안되네요..ㅜㅜ
<XML>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffffff"
android:id="@+id/relative"
>
<com.example.ightcamera.MyCameraSurface
android:id="@+id/previewFrame"
android:layout_width="fill_parent"
android:layout_height="match_parent" />
</RelativeLayout>
은 위와 같구요..
<JAVA>
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//iconLayout = (RelativeLayout) findViewById(R.id.iconLayout);
mSurface = (MyCameraSurface)findViewById(R.id.previewFrame);
mShutter = (Button)findViewById(R.id.button1);
//back_ground = (ImageView)findViewById(R.id.backGround);
RelativeLayout layout = (RelativeLayout)findViewById(R.id.relative);
ImageView imageView = new ImageView(getBaseContext());
Drawable rightArrowBlackDrawable = getResources().getDrawable(R.drawable.back_pattern2);
imageView.setLayoutParams(getLayoutParams());
imageView.setImageDrawable(rightArrowBlackDrawable);
imageView.bringToFront();
//layout.addView(back_ground,0);
mShutter.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
mSurface.mCamera.autoFocus(mAutoFocus);
}
});
}
로 해도 back_pattern2.png 파일이 반투명 상태로 프리뷰 위에 같이 나타나지 않고
프리뷰만 나옵니다..
고수님들 도와주세요 ㅠㅠ
감사합니다.