2017-10-08 180 views
-1

我正在使用Android Studio 2.3.3并创建应用程序。我已经作出了使用约束布局的注册页面,如下所示:在Android Studio中增加ImageView的大小

Layout

这是我想看看在所有设备上,但是,在我的万普拉斯2布局进行测试时变成:

Layout

正如你在我的设备上看到的,最后一个EditText和Button之间有一堆空白。

图片查看XML属性

android:id="@+id/imageProfile" 
    android:layout_width="match_parent" 
    android:layout_height="150dp" 
    android:layout_marginBottom="8dp" 
    android:layout_marginEnd="16dp" 
    android:layout_marginLeft="16dp" 
    android:layout_marginRight="16dp" 
    android:layout_marginStart="16dp" 
    android:layout_marginTop="8dp" 
    android:adjustViewBounds="false" 
    android:cropToPadding="false" 
    android:src="@mipmap/ic_launcher" 
    app:civ_border_color="#FF000000" 
    app:civ_border_width="2dp" 
    app:layout_constraintBottom_toTopOf="@+id/btnRegister" 
    app:layout_constraintLeft_toLeftOf="parent" 
    app:layout_constraintRight_toRightOf="parent" 
    app:layout_constraintTop_toBottomOf="@+id/txtPasswordConfirm" 
    app:layout_constraintVertical_bias="0.5" 

我的ImageView被设定为一组高度可能是原因,但我怎么得到它调整杉更大的屏幕?

文件夹结构

image

我如何去有关解决此问题?任何帮助表示赞赏。 在此先感谢。

+0

它总是更好的来发表您的完整代码。别担心,没有人会偷走它! – mrid

+1

只是想简洁哈哈 –

回答

1

像这样:

android:layout_width="0dp" 
android:layout_height="0dp" 
android:adjustViewBounds="true" 
android:scaleType="fitCenter" 
+0

完美,谢谢。 –