我有一个带有背景图像的线性布局。在创建线性布局之前,我需要滚动视图。在我这样做之后,我在线性布局上的图像被拉伸了。你能帮我创建我的图像,这样它就不会被拉伸吗?
这是我在 .xml 上的代码
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height= "wrap_content"
android:gravity="center_horizontal"
android:background="@drawable/bg_image_login"
android:orientation="vertical"
android:windowSoftInputMode="stateVisible|adjustResize"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.fania.suara_project.LoginActivity">
<ImageView
android:id="@+id/haha"
android:background="drawable/bg_image_login"
android:scaleType="fitXY"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
请帮帮我。谢谢你 :)
把滚动视图背景
android:background="@drawable/bg_image_login"
而不是线性布局。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句