반투명 버튼을 어떻게 만들어야 할지 모르겠네요..
eclipse 에서 xml 파일하나 생성한다음
[topbutton.xml]
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rama"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<ImageButton
android:id="@+id/norma"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/normalbackground"
android:clickable="true"
android:focusable="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="5dip"
android:layout_marginTop="5dip"
android:scaleType="center" />
</FrameLayout>
다음과 같이 속성을 줬습니다. 헌데 아래 만들어 놓은 다른 버튼이 전부 사라져 버리네요.
onCreate 함수 내에서 다음과 같은 명령어로 호출 하였습니다.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
...........
setContentView(R.layout.camera);
}
onCreate 내에서 잘못 호출 한거 같은데 어떻게 해야 하나요?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/black">
<Gallery android:id="@+id/gallery"
android:background="#55000000"
android:layout_width="fill_parent"
android:layout_height="80dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:spacing="16dp"
/>
<ImageSwitcher android:id="@+id/switcher"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/gallery"
android:layout_marginTop="11dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="@color/black"/>
<!-- 버튼 부분 xml 코드 추가 -->
</RelativeLayout>
보시는 것 처럼 레이아웃 부분에 자기가 원하는 뷰를 계속 넣을 수 있습니다.
물론 레이아웃 안에 레이아웃도 넣을 수 있고요..