2015-01-16 6 views
0

내 앱을 실행하는 데 USB 연결 장치를 사용하고 있습니다. 이 연습 앱에서는 Android 로고 이미지를 사용하여 확대/축소 기능을 구현했습니다. 활동에서 이미지 크기를 변경하려고하면 USB 장치로 가져온 앱을로드 할 때 변경 사항이 표시되지 않습니다. 로고는 단순히 맞게 확대됩니다. http://www.c-sharpcorner.com/UploadFile/88b6e5/multi-touch-panning-pinch-zoom-image-view-in-android-using/ 그것은과 기능에서 더블 탭 줌이없는 : 나는 줌을 구현하기 위해 소스 코드를 포크 http://i.imgur.com/hcaOHjW.pngAndroid Studio의 에뮬레이터에서 이미지 크기가 조절되지 않습니다.

:하지만 그것이 내가 디자인 뷰에서 볼 방식으로 이미지를 표시 할 자바 클래스

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" 
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 
android:paddingBottom="@dimen/activity_vertical_margin" 
tools:context="com.example.test.firstapp.Login" 
android:id="@+id/activity_activity2" 
android:focusable="false" 
android:nestedScrollingEnabled="false"> 

<ImageView 
    android:layout_width="180dp" 
    android:layout_height="220dp" 
    android:id="@+id/botImg" 
    android:src="@drawable/bot" 
    android:layout_centerVertical="true" 
    android:layout_centerHorizontal="true" 
    android:adjustViewBounds="true"/> 

답변

0

이보기를 만들어보십시오 : 그래서 제가

그리고 여기 내 활동에 대한 코드입니다 구현하기 위해 추가 할 수 있습니다 알려 그런 다음 height 및 width 매개 변수를 변경해보십시오.이 뷰를 동적으로 수정하고 Java 자체에서 매개 변수를 할당하십시오.이 뷰에는 xml을 사용하지 마십시오.

관련 문제