我在 CardView 中使用了 LinearLayout 来获得一种社交媒体登录按钮的外观,一切都运行良好,但 Android Studio 标记Element LinearLayout is not allowed here
。我想知道为什么会出现这种情况?我的xml是这样的:
<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>
只是为了得到一个正确的答案,例如@黑光 https://stackoverflow.com/users/865900/blacklight评论中说,这是一个 IDE 问题,因此重新启动应该可以解决问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)