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

Multi Page 중에 비트맵 그림 그리기 질문입니다.

0 추천
<LinearLayout android:background="#4ABFD3" android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" 
    xmlns:android="http://schemas.android.com/apk/res/android">


<LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="horizontal">

    
<Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Page 1" android:id="@+id/btnpage1"/>

<Button  android:layout_width="wrap_content"    android:layout_height="wrap_content"  android:text="Page 2"   android:id="@+id/btnpage2" />

<Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Page 3" android:id="@+id/btnpage3"/>

</LinearLayout>


<FrameLayout android:layout_height="match_parent" android:layout_width="match_parent">


<LinearLayout android:background="#D5D5D5" android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" android:id="@+id/page1">

<ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/picture" android:layout_gravity="center" android:src="@drawable/mainicon"/>

<TextView android:layout_height="wrap_content" android:layout_width="match_parent" android:text="제목" android:layout_below="@id/picture" android:textStyle="italic|bold" android:textSize="20pt" android:textColor="#000000"/>

     <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="hello 다시다시"/>      
     <ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content" />
     <Button android:text="Start"  android:id="@+id/StartStopButton" android:layout_width="wrap_content" android:layout_height="wrap_content" />
 
</LinearLayout>


<RelativeLayout android:background="#D5D5D5" android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/page2" android:visibility="invisible">

<EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="두 번째 페이지 가청 주파수 측정할거임" android:layout_alignParentLeft="true"/>

<Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Button" android:layout_alignParentBottom="true"/>

</RelativeLayout>
<LinearLayout android:background="#D5D5D5" android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/page3" android:visibility="invisible">
   <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="hello 다시다시"/>      
     <ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content" />
     <Button android:text="Start"  android:id="@+id/StartStopButton" android:layout_width="wrap_content" android:layout_height="wrap_content" />
 
 
</LinearLayout>
</FrameLayout>
</LinearLayout>

btnpage3에서 ImageView부터 나오지 않는데 , 이것만 따로 떼서 한 페이지로 실행하면 뜨는데 멀티 페이지로 하니 나오질 않네요 ㅠㅠ MainActivity에서 어디를 건드려야 할까요?? 

 

     imageView = (ImageView)findViewById(R.id.ImageView01);

       bitmap = Bitmap.createBitmap((int)256, (int)100, Bitmap.Config.ARGB_8888);

        canvas = new Canvas(bitmap);

        paint = new Paint();

        paint.setColor(Color.GREEN);

        imageView.setImageBitmap(bitmap);

이 부분의 위치가 문제인건지 감이 안잡혀요 고수님들 도와주세요 부탁드립니다 

 

쩌쩌롤 (180 포인트) 님이 2015년 3월 4일 질문

1개의 답변

+1 추천
 
채택된 답변

<ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content" />

 

ImageView를 선언하셨는데, imageview에 들어가는 그림을 선언하지 않으신거 같은데,

ImagteView부터 나오지 않는다는 게 무슨 말이죠???

 

아 Imageview는 그냥 대충 linearlayout에서 여백을 나타내려고 넣으신거고,

그 밑에 Button이 안나온다는거죠??

Djleeee (13,180 포인트) 님이 2015년 3월 5일 답변
쩌쩌롤님이 2015년 3월 9일 채택됨
relativelayout이 wrap_content로 화면을 다 잡아먹을 거같은데,그 밑의 linearlayout은 화면에 안 나올거 같은딩@_@ 지금 시간이 새벽 5시라 테스팅은 지쳐서 못해보겠고 ㅈㅅㅈㅅ ㅜㅜ
텍스트가 문제가 있더라구요 ㅎㅎ 리니어레이아웃으로 바꾸고 수평, 수직 바꿔보니까 나오더라구요 ㅎㅎ 감사합니다 덕분에 감잡을수 있었어요^^
...