2016-10-19 10 views
0

私の活動ページでスクロールビューを使用しています。xmlの開始時に、私はこのscrollViewを使用していますが、LinearLayoutsが異なります。文字列の型が許可されていません(値 'match-parent'の 'layout_height')

<?xml version="1.0" encoding="utf-8"?> 

<ScrollView  
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_height="match-parent"  
    android:layout_width="match-parent"> 


<LinearLayout 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" 
    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.hsports.bandpop.MainActivity" 
    android:orientation="vertical">  

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/title" 
     android:text="POP BANDS" 
     android:gravity="center"  
     android:textSize="50dp" /> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 
     android:layout_gravity="center"  
     android:paddingTop="100dp" > 

    <AutoCompleteTextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/username" 
     android:hint="Username" 
     android:gravity="center"/> 

    <AutoCompleteTextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/password" 
     android:hint="Password" 
     android:gravity="center" 
     android:inputType="textPassword"/> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    android:paddingTop="50dp"> 

     <Button 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="SIGN IN" 
      android:onClick="checkSignIn" 
      android:gravity="center" /> 

     <Button 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="REGISTER" 
      android:onClick="registerForm" 
      android:gravity="center"/> 

</LinearLayout> 
    </LinearLayout> 


</LinearLayout> 
</ScrollView> 

私は取得していますエラーは次のとおりです。 エラー:(7、28)の文字列型は、(価値の 'layout_height' 'マッチ親' で)許可されていません。 エラー:(9,27)文字列型は許可されません(値 'match-parent'の 'layout_width')。

+0

で変更して、プロジェクトを再構築してください – curiousMind

答えて

4

これはmatch_parentではなく、match-parentです。 _で、-ではありません。それをあなたのScrollViewlayout_heightlayout_width

関連する問題