首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >android图像视图转换为相对布局设置高度

android图像视图转换为相对布局设置高度
EN

Stack Overflow用户
提问于 2017-02-27 15:56:17
回答 3查看 734关注 0票数 -1

我在Relativelayout中有一个图像视图,我从图库中挑选图像。问题是Imageview高度太大,相对布局父高度变得与Imageview高度相同,我需要从图库中挑选图像并将其准确地显示到这个相对布局中。

在我的代码下面

代码语言:javascript
运行
复制
    <RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/image_view"
            android:layout_margin="5dp"
            android:layout_alignParentEnd="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:scaleType="fitStart"
            android:adjustViewBounds="true"
            android:src="@drawable/crayon" />

</RelativeLayout>
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42480426

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档