为了显示带有圆角的webview,我将其放入一个CardView中,结果正如预期的那样,是一个带有圆角的webview。
但当在lollipop上测试应用程序时,这些角并不是圆角,只显示了一个简单的when视图。如何在lollipop上修复它
更新:代码如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#222222"
android:clickable="true">
<androidx.cardview.widget.CardView
android:id="@+id/card_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_marginLeft="25dp"
android:layout_marginTop="50dp"
android:layout_marginRight="25dp"
android:layout_marginBottom="50dp"
app:cardCornerRadius="30dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:id="@+id/top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:clickable="true"
app:cardElevation="10dp">
<RelativeLayout
android:id="@+id/page_address"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_margin="10dp"
android:background="@drawable/round_edge">
<TextView
android:id="@+id/address_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginLeft="45dp"
android:layout_marginRight="45dp"
android:drawablePadding="2dp"
android:ellipsize="end"
android:lines="1"
android:textColor="#000000"
android:textSize="14dp" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/top_bar"
android:scrollbars="none" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
发布于 2020-02-26 20:21:05
在您的app.gradle中进行如下更改
compileSdkVersion 29
minSdkVersion 15
targetSdkVersion 29和同步项目
https://stackoverflow.com/questions/60409204
复制相似问题