Ich versuche eine Symbolleiste in meinen XML-Dateien hinzuzufügen. SoWo kann ich in meine XML-Datei aufnehmen?
Ich habe toolbar.xml und ich brauche, um es in upload.xml umfassen:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_upload"
android:layout_width="match_parent"
android:padding="10dp"
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"
tools:context="com.sk.mf.Upload"
android:background="#fff">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageToUpload"
android:layout_gravity="center_horizontal"
android:layout_width="150dp"
android:layout_height="150dp" />
<EditText
android:id="@+id/etUploadName"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/bUploadImage"
android:text="Upload Image"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
das Problem ist, überall, wo ich es stelle ich hatte Fehler wie: Scroll nur eine direkte Kind aufnehmen kann (inside scrollview) mehrere root-Tags (nach scrollview) ...
meine Frage hier ist, wo und wie kann ich den Code unten in der Xml oben setzen?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include android:id="@+id/toolbar" layout="@layout/toolbar"></include>
</RelativeLayout>
ich danke Ihnen sehr! –