2014-04-14 2 views
0

텍스트가 "큰 텍스트"인 텍스트보기가 있습니다. 높이와 너비가 텍스트보기의 이미지보기로 변환하고 싶습니다. 이미지가 텍스트보기와 같이 나타나야합니다. 예를 들어, 텍스트가 "환영합니다."인 경우 이미지보기도 텍스트를 동일한 방식으로 표시해야합니다. 텍스트 버튼을 클릭하면 텍스트보기가 나타납니다. 제발 도와주세요. 내 XML 파일은안드로이드에서 textview를 imageview로 변환하는 방법은 무엇입니까?

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:id="@+id/relative" > 

<TextView 
    android:id="@+id/textView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentTop="true" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="30dp" 
    android:text="Large Text" 
    android:textAppearance="?android:attr/textAppearanceLarge" /> 

<ImageView 
    android:id="@+id/imageView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/textView1" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="96dp" 
    /> 

<Button 
    android:id="@+id/button1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/imageView1" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="99dp" 
    android:text="Convert" /> 

</RelativeLayout> 
+0

당신은'ImageView' 대신'Button'을 사용할 수 있습니다. –

+0

제 요구 사항에 따르면 이미지보기 만 사용해야합니다. 회신 해 주셔서 감사합니다. – Lakshmipathi

+0

Button을 사용할 수 없다는 요구 사항은 무엇입니까? –

답변

0

사용할 수 있습니다. 비트 맵 bmp =보기 .getDrawingCache(); ImageView.setImageBitmap (bmp);

관련 문제