Подтвердить что ты не робот

LinearLayout помечен, если используется в CardView

Я использовал LinearLayout в CardView, чтобы получить вид кнопки входа в систему в социальных сетях, и все работает отлично, но флаги 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>
4b9b3361

Ответ 1

Просто чтобы получить правильный ответ, как сказал @Blightlight в комментариях, это проблема IDE, поэтому ее перезапуск должен решить проблему.

Ответ 2

Помимо других предложений и приведенного выше ответа, эта проблема возникает у меня, если я не обновил свою библиотеку поддержки до AndroidX, в данном случае это CardView. Так из

android.support.v7.widget.CardView

необходимо изменить на

androidx.cardview.widget.CardView

и предупреждение должно исчезнуть.

enter image description here