rounded-corners

Android - drawable with rounded corners at the top only

余生长醉 提交于 2019-11-26 15:45:40
I had this drawable to have a rounded rectangle as a background: <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/white" /> <stroke android:width="1dp" android:color="@color/light_gray" /> <padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" /> <corners android:radius="6dp" /> </shape> This is working fine, as expected. Now, I want to change this to only round the top corners, so I change it to this: <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/white" />

Border over a bitmap with rounded corners in Android

旧巷老猫 提交于 2019-11-26 13:58:40
问题 I used the below to make a bitmap with rounded corners. Now I want to draw a line around the bitmap. private BitmapDrawable roundCornered(BitmapDrawable scaledBitmap, int i) { Bitmap bitmap = scaledBitmap.getBitmap(); result = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); canvas = new Canvas(result); color = 0xff424242; paint = new Paint(); rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); rectF = new RectF(rect); roundPx = i; paint

How to create EditText with rounded corners?

 ̄綄美尐妖づ 提交于 2019-11-26 13:57:43
Is there any way to create EditText that has rounded corners? There is an easier way than the one written by CommonsWare. Just create a drawable resource that specifies the way the EditText will be drawn: <?xml version="1.0" encoding="utf-8"?> <!-- res/drawable/rounded_edittext.xml --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp"> <solid android:color="#FFFFFF"/> <corners android:bottomRightRadius="15dp" android:bottomLeftRadius="15dp" android:topLeftRadius="15dp" android:topRightRadius="15dp"/> </shape> Then, just reference

How to make round corners to both inside of a box and its border?

你离开我真会死。 提交于 2019-11-26 13:09:15
问题 I guess the title is kind of hard to understand, so I\'ll explain. I am trying to achieve this effect: (a box which has rounded corners and its border, which also has rounded borders). I\'ve managed to do this, by using the background-clip property: (rounded corners for border but not for inner box) The question is, how can I achieve rounded corners for the inner box? Thank you! EDIT The HTML I am using: <header class=\"body template-bg template-border radius-all\"> <nav> <ul> <li><a href=\"#

How is a rounded rect view with transparency done on iphone?

霸气de小男生 提交于 2019-11-26 12:50:21
问题 A lot of apps pop up a transparent view with rounded corners and an activityIndicator when running a time consuming operation. How is this rounding done and is it possible to do it just using Interface Builder (as there are lots of places I\'d like to use something like this)? Or, should I use an imageview with a rounded rect or stretchable image? Do I need to draw the background myself? So far, I have managed to get a basic view with similar transparency by setting the alphaValue in

Round two corners in UIView

老子叫甜甜 提交于 2019-11-26 12:00:58
A little while ago I posted a question about rounding just two corners of a view , and got a great response, but am having problems implementing it. Here is my drawRect: method: - (void)drawRect:(CGRect)rect { //[super drawRect:rect]; <------Should I uncomment this? int radius = 5; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextBeginPath(context); CGContextAddArc(context, rect.origin.x + radius, rect.origin.y + rect.size.height - radius, radius, M_PI, M_PI / 2, 1); CGContextAddArc(context, rect.origin.x + rect.size.width - radius, rect.origin.y + rect.size.height - radius,

C# Form with custom border and rounded edges [duplicate]

亡梦爱人 提交于 2019-11-26 11:29:56
问题 This question already has an answer here: How to Draw a Rounded Rectangle with WinForms (.NET)? 6 answers I am using this code to make my form (FormBorderStyle=none) with rounded edges: [DllImport(\"Gdi32.dll\", EntryPoint = \"CreateRoundRectRgn\")] private static extern IntPtr CreateRoundRectRgn ( int nLeftRect, // x-coordinate of upper-left corner int nTopRect, // y-coordinate of upper-left corner int nRightRect, // x-coordinate of lower-right corner int nBottomRect, // y-coordinate of

Rounded edges in button C# (WinForms)

人走茶凉 提交于 2019-11-26 11:17:49
问题 Hello, through some research around here and other sites, I\'ve made a rounded edges button. protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Rectangle Rect = new Rectangle(0, 0, this.Width, this.Height); GraphicsPath GraphPath = new GraphicsPath(); GraphPath.AddArc(Rect.X, Rect.Y, 50, 50, 180, 90); GraphPath.AddArc(Rect.X + Rect.Width - 50, Rect.Y, 50, 50, 270, 90); GraphPath.AddArc(Rect.X + Rect.Width - 50, Rect.Y + Rect.Height - 50, 50, 50, 0, 90); GraphPath.AddArc(Rect

Rounded Corners only on Top of a UIView

空扰寡人 提交于 2019-11-26 10:28:49
问题 Hi i am searching a clean solution without overwriting drawRect or stuff like that to create a UIView with Rounded corners on the Top of the View . My main problem here is to create variable solution if the view is getting resized or something like that. Is there a clean solution? Apple is this doing too on the first table item. it can\'t be so hard to do this. 回答1: You can do this by setting a mask on your view's layer: CAShapeLayer * maskLayer = [CAShapeLayer layer]; maskLayer.path =

Rounded table corners CSS only

﹥>﹥吖頭↗ 提交于 2019-11-26 09:28:55
问题 I have searched and searched, but haven\'t been able to find a solution for my requirement. I have a plain ol\' HTML table. I want round corners for it, without using images or JS, i.e. pure CSS only . Like this: Rounded corners for corner cells, and 1px thick border for the cells. So far I have this: table { -moz-border-radius: 5px !important; border-collapse: collapse !important; border: none !important; } table th, table td { border: none !important } table th:first-child { -moz-border