rounded-corners

UIView with rounded corners and drop shadow?

邮差的信 提交于 2019-11-25 23:23:25
问题 I want a custom UIView ... : I just wanted a blank white view with rounded corners and a light drop shadow (with no lighting effect). I can do each of those one by one but the usual clipToBounds / maskToBounds conflicts occur. 回答1: The following code snippet adds a border, border radius, and drop shadow to v , a UIView : // border radius [v.layer setCornerRadius:30.0f]; // border [v.layer setBorderColor:[UIColor lightGrayColor].CGColor]; [v.layer setBorderWidth:1.5f]; // drop shadow [v.layer

How to make an ImageView with rounded corners?

﹥>﹥吖頭↗ 提交于 2019-11-25 21:44:21
问题 In Android, an ImageView is a rectangle by default. How can I make it a rounded rectangle (clip off all 4 corners of my Bitmap to be rounded rectangles) in the ImageView? 回答1: This is pretty late in response, but for anyone else that is looking for this, you can do the following code to manually round the corners of your images. http://www.ruibm.com/?p=184 This isn't my code, but I've used it and it's works wonderfully. I used it as a helper within an ImageHelper class and extended it just a

How to make the corners of a button round? [closed]

独自空忆成欢 提交于 2019-11-25 20:11:47
I want to make the corners of a button round. Is there an easy way to achieve this in Android? Md. Monsur Hossain Tonmoy If you want something like this here is the code. 1.Create a xml file in your drawable folder like mybutton.xml and paste the following markup: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="true" > <shape android:shape="rectangle" > <corners android:radius="3dip" /> <stroke android:width="1dip" android:color="#5e7974" /> <gradient android:angle="-90" android:startColor="#345953"