0

글라이드를 사용하여 ImageButton보기에서 이미지를로드합니다. 버튼을 클릭하면 카메라가 열리고 찍은 사진은 버튼으로 이동합니다. 나는 이상한 문제에 직면 해있다. 사진을 찍을 때마다 버튼의 이미지가 커진다.ImageButton 점점 더 커지고 있습니다.

왜 그런 생각이 들지?

일부 코드가 도움이 될 수 있습니다 : XML 파일에

// I use this to update the ImageButton 
RequestManager glide = Glide.with(this); 
glide.clear(mLeftTopImageButton); 
glide.load(file.getAbsolutePath()).into(mLeftTopImageButton); 

을 :

<LinearLayout 
    android:orientation="vertical" 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="12dp" 
    android:layout_weight="1" > 
    <ImageButton 
     android:background="?android:colorBackground" 
     android:id="@+id/button1_image" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:src="@android:drawable/ic_menu_camera" /> 
    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textSize="12sp" 
     android:textStyle="bold" 
     android:gravity="center_horizontal" 
     android:text="Button1"/> 
</LinearLayout> 

편집 : 여기

이미지

의 exemple입니다 16,

감사합니다, @ "더 그랜드 싱 Fauzdar"으로

+0

큰 방법? 높이, 너비 또는 둘 다? 'ImageView'는 더 커지거나 그냥 이미지가됩니까? –

+0

이미지 크기를 기준으로 ImageButton 크기를 늘리거나 줄입니다. 따라서 이미지의 일관성을 유지하려는 경우 ImageButton의 크기를 수정하십시오. – Prasad

+0

너비는 이미 'LinearLayout' 가중치로 고정해야합니다? 문제를 보여주는 2 개의 스크린 샷을 추가하겠습니다. –

답변

0

는이 문제를 방지하기 위해 높이를 해결하기에 충분했다.

+0

만나서 반갑습니다. –