API 21+上的视图剪切/填充损坏

时间:2019-06-14 13:14:18

标签: android material-design android-5.0-lollipop android-appcompat androidx

android API 19:

android API 21 :(没有任何余量)

在appcompat和androidx中,在模拟器和真实设备上的结果相同。

我如何在KitKat上但在Lollipop设备上却能获得图片?因为Lollipop设备上的某些CardView看起来像是一个大的破损视图

音乐回收器项目布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/musicrecyclerhelpLinearLayout1">

    <TextView
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:layout_width="wrap_content"
        android:id="@+id/musicrecyclerhelpTextView1"
        android:layout_marginLeft="10dp"
        android:text="why you can see this?"
        android:layout_centerVertical="true"
        android:layout_alignParentLeft="true"/>

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        app:srcCompat="@drawable/v_play"
        app:fabSize="normal"
        android:id="@+id/musicrecyclerhelpFloatingActionButton1"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"/>

</RelativeLayout>

卡片查看代码:

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card="http://schemas.android.com/apk/res-auto"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" />
</com.google.android.material.card.MaterialCardView>

0 个答案:

没有答案
相关问题