我有一個ImageView的和我試圖創建圓角,嘗試了所有從這個職位的解決方案:How to make an ImageView with rounded corners?但是毫無效果。這裏是我的XML機器人試圖圓位圖的角落
<RelativeLayout
android:id="@+id/RL_ImageHolder"
android:layout_width="150dp"
android:layout_height="180dp"
android:layout_alignBottom="@+id/relativeLayout2"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/relativeLayout2"
android:layout_marginLeft="10dp" >
<ImageView
android:id="@+id/imgPreview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:contentDescription="Preview"
/>
</RelativeLayout>
這就是我如何使用在帖子中提到的方法我上面鏈接設置的ImageView:
圖像設置正確,但它使一個矩形。任何想法,爲什麼它不工作?
編輯:剛剛發現,只有當持有圖像的佈局具有固定的寬度/高度時才起作用。想一想如何管理它。謝謝你們
檢查:[Android配方#1,帶圓角的圖像](http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners) [Romain Guy](http://stackoverflow.com/users/298575/romain-guy) –