마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

레이아웃을 나눈뒤 비트맵이미지 띄우기

0 추천
 <LinearLayout
            android:id="@+id/gameview1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/button01"
                android:layout_width="fill_parent"
                android:layout_height="50dip"
                android:layout_gravity="bottom"
                android:background="@drawable/s1" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/gameview2"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/button02"
                android:layout_width="fill_parent"
                android:layout_height="50dip"
                android:layout_gravity="bottom"
                android:layout_weight="1"
                android:background="@drawable/s2" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/gameview3"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/button03"
                android:layout_width="fill_parent"
                android:layout_height="50dip"
                android:layout_gravity="bottom"
                android:layout_weight="1"
                android:background="@drawable/s3" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/gameview4"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/button04"
                android:layout_width="fill_parent"
                android:layout_height="50dip"
                android:layout_gravity="bottom"
                android:layout_weight="1"
                android:background="@drawable/s4" />
        </LinearLayout>

이렇게 4개로 한 화면을 4개의 레이아웃(gameview1, 2, 3, 4) 등으로 나누고

이제 자바소스에서 선언한뒤가 문제인데요

gameview1 = (LinearLayout) findviewbyid(R.id.gameview1);

이렇게 선언한후

gameview1에 비트맵 이미지를 그리고 gameview2에 또 비트맵 이미지 그리고 할려는데

어떤식으로 코드를 짜야할찌 모르겠어서 질문드립니다.

예를 들어 버튼클릭시면 Button1.onClick~~~~

이렇게 있는데 위에 같은 경우도

gameview1.~~~ 이런 식으로 코드가 있는지 궁금합니다.

 

 

 

 

익명사용자 님이 2014년 9월 24일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...