11

Ich habe ein LinearLayout in einem CardView verwendet, um eine Art von Social Media Login Button Look und alles läuft gut, aber Android Studio Flags Element LinearLayout is not allowed here. Ich habe mich gefragt, warum das der Fall sein könnte? Mein xml ist dies:LinearLayout gekennzeichnet, wenn in CardView verwendet

<android.support.v7.widget.CardView 
      xmlns:card_view="http://schemas.android.com/apk/res-auto" 
      android:layout_below="@id/cv_fb" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      card_view:cardElevation="3dp" 
      > 

      <LinearLayout 

       android:id="@+id/ll_entitlement_extend_google" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="horizontal" 
       android:background="@color/white" 
       android:clickable="true" 
       android:gravity="center" 
       android:paddingTop="10dp" 
       android:paddingBottom="10dp" 
       > 

       <ImageView 
        android:layout_weight="1" 
        android:layout_width="75dp" 
        android:layout_height="75dp" 
        android:src="@drawable/google_icon"/> 

       <TextView 
        android:layout_weight="1" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Connect with Google +"/> 

       <ImageView 
        android:layout_weight="1" 
        android:layout_width="25dp" 
        android:layout_height="25dp" 
        android:src="@drawable/ic_chevron_right_black"/> 


      </LinearLayout> 
     </android.support.v7.widget.CardView> 
+0

wahrscheinlich einige SDK-Anhänge. Säubern Sie Ihr Projekt und versuchen Sie es erneut. –

+6

Es ist eher ein IDE-Problem. Die Reinigung funktionierte nicht für mich, aber Android Android Studio einfach neu zu reparieren. – Blacklight

+0

Ah danke :) – AmaJayJB

Antwort

26

nur eine richtige Antwort zu haben, wie @Blacklight in den Kommentaren gesagt, es ist ein IDE-Problem so einen Neustart es das Problem beheben soll.

+2

Dies ist das zugehörige Problem: https://code.google.com/p/ android/issues/detail? id = 81362 – gian1200