2017-11-17 4 views
2

のAndroid 4.3に半径を表示しません:あなたは半径のImageViewの成功のショーを見ることができるようにここでImageViewのは、ここに私のレイアウトのxml

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:card_view="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/catalog_item_card_view" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    card_view:cardCornerRadius="5dp" 
    card_view:cardUseCompatPadding="true"> 

    <android.support.constraint.ConstraintLayout 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 

     <ImageView 
      android:id="@+id/imageViewPhoto" 
      android:layout_width="wrap_content" 
      android:layout_height="160dp" 
      android:src="@drawable/test_merchant_preview" 
      card_view:layout_constraintLeft_toLeftOf="parent" 
      card_view:layout_constraintRight_toRightOf="parent" 
      card_view:layout_constraintTop_toTopOf="parent" /> 

    </android.support.constraint.ConstraintLayout> 


</android.support.v7.widget.CardView> 

radius

Andrdoid 5.0以上になります。 OK。

Android 4.3でアプリを実行しました。

そして、ここで結果: no_radius

あなたが半径なしImageViewのショーを見ることができるように。 なぜですか?

+1

、このような交差を避けるためにパディングを追加し、それは、Android 5.0を下回る動作しません。あなたはドロアブルを使ってやる必要があります。 – Umair

答えて

1

CardViewでImageViewの唯一のAndroid 5.0で動作し、

CardView上にシャドウのロリポップに標高プロパティを使用し、バックカスタムにフォール

CardView

4.3 Androidの標高に半径が表示されません古いプラットフォームでのエミュレートされたシャドウインプリメンテーション

ラクロスコーナークリッピングの高価な性質のため、Lollipopの前のプラットフォームでは、CardViewは丸いコーナーで交差する子を切り取りません。代わりに、それは

詳しくread here

関連する問題