상위 뷰의 크기와 상관없이 동일한 크기 조정을위한 로고를 얻으려고합니다. 현재 로고는 수직으로 축소되지만 수평으로는 로고가 흐리게 표시됩니다. 나는 x와 y를 동일하게 스케일링하여 모양이 뭉개지거나 펴지지 않은 형태로 유지하도록하고 싶습니다.이미지의 X와 Y를 Android의 ImageView에서 동일하게 스케일하는 방법은 무엇입니까?
다양한 scaleTypes를 시도했지만 지금까지는 도움이되지 않았습니다. 버튼
XML 코드 :
<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/title"
android:background="@android:color/transparent"
android:src="@android:color/transparent" />
FULL XML 코드 (CONTEXT를 줄) :
이미지 디스플레이는 두 가지 요인에 의해 결정됩니다<RelativeLayout
android:id="@+id/menu"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="30"
android:background="@android:color/transparent"
android:baselineAligned="false" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:gravity="right|bottom"
android:shadowColor="@android:color/transparent"
android:text="THE BLIND GOAT"
android:textColor="@android:color/transparent"
android:textSize="24dp"
android:textStyle="bold|italic"
android:typeface="sans" />
<Button
android:id="@+id/help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:background="@android:color/transparent"
android:clickable="false"
android:paddingBottom="0dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingTop="0dp"
android:text="HELP"
android:textColor="@android:color/transparent"
android:textSize="9dp"
android:textStyle="bold"
android:typeface="monospace" />
<Button
android:id="@+id/settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/help"
android:layout_below="@id/title"
android:background="@android:color/transparent"
android:clickable="false"
android:paddingBottom="0dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingTop="0dp"
android:text="SETTINGS"
android:textColor="@android:color/transparent"
android:textSize="9dp"
android:textStyle="bold"
android:typeface="monospace" />
<Button
android:id="@+id/logout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/settings"
android:layout_below="@id/title"
android:background="@android:color/transparent"
android:clickable="false"
android:paddingBottom="0dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingTop="0dp"
android:text="LOGOUT"
android:textColor="@android:color/transparent"
android:textSize="9dp"
android:textStyle="bold"
android:typeface="monospace" />
<Button
android:id="@+id/profile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/settings"
android:background="@android:color/transparent"
android:clickable="false"
android:textColor="@android:color/transparent"
android:textSize="15dp"
android:textStyle="bold"
android:typeface="serif" />
<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/title"
android:background="@android:color/transparent"
android:src="@android:color/transparent"
android:scaleType="centerCrop" />
</RelativeLayout>
시도하십시오 android : scaleType = "centerInside" –
그래, 그게 많은 스케일 타입 중 하나입니다. 감사. – jrquick
오해해서 죄송합니다. 나는 당신의 코멘트를 보지 못했고 아마 우리는 같은 시간에 썼을 것입니다. 답변을 삭제했습니다. 좋은 날 –