Developing an application in Eclipse , I ran into a problem. I need to make the main layout ( main.xml ) scrollable. That is, so that with a large number of elements on the screen it can be scrolled down with a finger. For this, I used ScrollView , but I cannot compile and run the program. The compiler gives an error in these lines:

 <?xml version="1.0" encoding="utf-8"?> <ScrollView android:id="@+id/ScrollView1" android:layout_width="match_parent" android:layout_height="wrap_content" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" 

Here is the code itself:

 <?xml version="1.0" encoding="utf-8"?> <ScrollView android:id="@+id/ScrollView1" android:layout_width="match_parent" android:layout_height="wrap_content" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/LinearLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@drawable/background" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:isScrollContainer="true" tools:context=".MainActivity" > <TextView android:id="@+id/textViewPhoneNo" android:text="ΠšΠΎΠΌΡƒ :" android:layout_width="0dp" android:layout_height="0dp" android:textAppearance="?android:attr/textAppearanceLarge" /> <EditText android:id="@+id/editTextTo" android:layout_width="0dp" android:layout_height="0dp" android:inputType="textEmailAddress" > <requestFocus /> </EditText> <TextView android:id="@+id/textViewSubject" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Π—Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ :" android:textAppearance="?android:attr/textAppearanceLarge" /> <EditText android:id="@+id/editTextSubject" android:layout_width="fill_parent" android:layout_height="45dp" /> <TextView android:id="@+id/textViewMessage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Π’Π°ΡˆΠ° история :" android:textAppearance="?android:attr/textAppearanceLarge" /> <EditText android:id="@+id/editTextMessage" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="top" /> <Button android:id="@+id/buttonSend" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="ΠžΡ‚ΠΏΡ€Π°Π²ΠΈΡ‚ΡŒ" /> <Button android:id="@+id/btnInfo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="О ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ" android:onClick="onclock" />" <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/message_text" android:autoLink="web" /> </LinearLayout> </ScrollView> 

    2 answers 2

    You have not closed the tag from ScrollView. That's right:

     <?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/ScrollView1" android:layout_width="match_parent" android:layout_height="wrap_content" > 

    And extra quotes at the very end here:

      <Button android:id="@+id/btnInfo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="О ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ" android:onClick="onclock" />" 

      Check if the special markup characters are in your lines (if inline content is present).

      " The compiler gives an error in these lines ... " - you did not say anything about the error, its description, but a whole paragraph was devoted to describing what programmer you are. Describe the error.