content_mail.xml文件将不会打开。我正在尝试为整个android屏幕生成一个ScrollView,用于其中的所有视图。代码如下,这是先前发布的代码的修订版本:
getInfo(id: number, token: string) {
let userData = this.http.get<User[]>(`${this.appLogin}` + id + '?token=' + token);
return this.http.get<User[]>(`${userData}`);
}
以上代码合并了我理解或误解的建议更改。一种建议是删除图像。但是我需要它们。
答案 0 :(得分:0)
删除 tools:showIn =“ @ layout / activity_main” ,然后将代码替换为以下代码,并将替换标记</RelativeLayout>
替换为</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginTop="56dp"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView"
android:layout_width="200dp"
android:layout_height="230dp"
android:layout_column="1"
android:background="@mipmap/ic_launcher"
android:contentDescription='android:ContentDescription="@string/desc"'
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/imageView"
android:background="#ffffff"
android:foreground="#05ffffff"
android:foregroundTint="#03ffffff"
android:text="We've been serving good people like you since 1994 with special deals on their travel plans. "
android:textColor="#000000" />
<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/text1"
android:text="Cancun, Chichen Itza." />
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/editText2"
android:text="Holbox, Taxco, Palenque, Acapulco, Ixtapa, Guanajuato,
Cabo San Lucas, Puerto Vallarta, Monterrey, Tenacatita, Mascota" />
<ImageButton
android:id="@+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/editText5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/editText3"
android:background="@mipmap/ic_launcher"
tools:ignore="ContentDescription" />
<EditText
android:id="@+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/editText"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignRight="@+id/editText"
android:layout_below="@+id/editText"
android:ems="10"
android:inputType="textEmailAddress"
android:text="thewebmaster@cancunsteve.com" />
<EditText
android:id="@+id/editText4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/editText3"
android:layout_marginLeft="42dp"
android:layout_marginStart="32dp"
android:ems="10"
android:inputType="phone"
android:text="011 52 998 8873919" />
<EditText
android:id="@+id/editText5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/editText4"
android:text="be sure to visit us discounts on your hotel bookings" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageButton"
android:text="click buttons multiple times to change state" />
</LinearLayout>
</ScrollView>