【发布时间】:2014-12-31 09:42:25
【问题描述】:
将所有内容放在一个文件中以使其更清晰,连同代码和结果:
【问题讨论】:
-
它不起作用...检查更新
-
因为您的要求不是标准 scaleType 使用 scaleType="matrix" 并计算矩阵以满足您的需求
标签: android xml image imageview scale
将所有内容放在一个文件中以使其更清晰,连同代码和结果:
【问题讨论】:
标签: android xml image imageview scale
试试这个..
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="false"
android:background="@drawable/image1"/>
编辑:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="2"
android:gravity="right" >
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:adjustViewBounds="false"
android:layout_gravity="right"
android:layout_weight="1"
android:background="@drawable/ic_launcher"/>
</LinearLayout>
edit2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="right"
android:orientation="vertical"
android:weightSum="10" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@drawable/ic_launcher" />
</LinearLayout>
【讨论】:
将图像视图的宽度设置为“fill_parent”。 它也解决了你的问题。
【讨论】: