美文网首页
ImageView 宽高按相同的比例展示

ImageView 宽高按相同的比例展示

作者: 菜鸟何时起飞 | 来源:发表于2020-04-20 14:57 被阅读0次

    1 父view高度设置wrap_content
    2 ImageView设置match_parent

       <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">
                    <ImageView
                        android:id="@+id/ivPic"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:scaleType="fitCenter" />
    

    相关文章

      网友评论

          本文标题:ImageView 宽高按相同的比例展示

          本文链接:https://www.haomeiwen.com/subject/sohdihtx.html