rounded-corners

WPF rounded corner textbox

喜欢而已 提交于 2019-11-26 22:16:11
问题 I don't know WPF and am now learning it. I was looking for rounded corners TextBox in WPF. So I searched Google and found a piece of XAML : <!–Rounded Corner TextBoxes–> <ControlTemplate x:Key=”RoundTxtBoxBaseControlTemplate” TargetType=”{x:Type Control}”> <Border Background=”{TemplateBinding Background}” x:Name=”Bd” BorderBrush=”{TemplateBinding BorderBrush}” BorderThickness=”{TemplateBinding BorderThickness}” CornerRadius=”6″> <ScrollViewer x:Name=”PART_ContentHost”/> </Border>

Just two rounded corners? [duplicate]

試著忘記壹切 提交于 2019-11-26 21:52:45
This question already has an answer here: Rounded UIView using CALayers - only some corners - How? 14 answers In my iPad app, I want a second view to appear within the main when the user clicks a button. The new view will be smaller than the first, and darken the background when it is displayed. I want the top two corners of the new view to appear rounded, but using cornerRadius sets all of them rounded. How can I make just two corners rounded? You have to do this in drawRect:. I actually modified the classic addRoundedRectToPath: so that it takes a bitmap and rounds the corners you request:

Round Top Corners of a UIButton in Swift

二次信任 提交于 2019-11-26 20:24:47
I know I can round all four corners using: myBtn.layer.cornerRadius = 8 myBtn.layer.masksToBounds = true Since I only want to round two, I did some research and found this : extension UIView { func roundCorners(corners:UIRectCorner, radius: CGFloat) { let path = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) let mask = CAShapeLayer() mask.path = path.CGPath self.layer.mask = mask } } Which is called like this: view.roundCorners([.TopLeft , .TopRight], radius: 10) Yet this doesn't work for a UIButton. When I switch the

UIImage with rounded corners

两盒软妹~` 提交于 2019-11-26 19:09:40
问题 I have read several posts already. And almost everyone suggest using QuartzCore/QuartzCore.h with layer.cornerRadius I have tried this method and some more methods. Well, everything works fine when an image doesn't move. But in my project I always move my images. If I add corner radius or a shadow the image movement is no longer smooth. And it looks aweful! That is the way I resize my image: CGSize newSize = CGSizeMake(200*height/image.size.height, 280); CGColorSpaceRef colorSpace =

How to create uneven rounded sides on a div?

社会主义新天地 提交于 2019-11-26 19:08:24
I've been trying to make a DIV with uneven rounded sides like this: I've checked some solutions and the closest I can get to it is by using border-radius. I've used: border-bottom-left-radius: 80%50px; border-bottom-right-radius: 30%30px; And this is what I've got: How can this be done? You can consider clip-path .box { height: 200px; width: 200px; background: blue; -webkit-clip-path: circle(75% at 65% 10%); clip-path: circle(75% at 65% 10%); } <div class="box"> </div> Or use radial-gradient .box { height: 200px; width: 200px; background: radial-gradient(circle at 65% 10%, blue 75%,transparent

How do I create a WPF Rounded Corner container?

大兔子大兔子 提交于 2019-11-26 18:47:14
问题 We are creating an XBAP application that we need to have rounded corners in various locations in a single page and we would like to have a WPF Rounded Corner container to place a bunch of other elements within. Does anyone have some suggestions or sample code on how we can best accomplish this? Either with styles on a or with creating a custom control? 回答1: You don't need a custom control, just put your container in a border element: <Border BorderBrush="#FF000000" BorderThickness="1"

How do I create a round cornered UILabel on the iPhone?

五迷三道 提交于 2019-11-26 18:10:28
Is there a built in way to create round-cornered UILabels? If the answer is no, how would one go about creating such an object? benzado iOS 3.0 and later iPhone OS 3.0 and later supports the cornerRadius property on the CALayer class. Every view has a CALayer instance that you can manipulate. This means you can get rounded corners in one line: view.layer.cornerRadius = 8; You will need to #import <QuartzCore/QuartzCore.h> and link to the QuartzCore framework to get access to CALayer's headers and properties. Before iOS 3.0 One way to do it, which I used recently, is to create a UIView subclass

How to programmatically round corners and set random background colors

こ雲淡風輕ζ 提交于 2019-11-26 17:57:21
问题 I'd like to round the corners of a view and also change the color of the view based on the contents at runtime. TextView v = new TextView(context); v.setText(tagsList.get(i)); if(i%2 == 0){ v.setBackgroundColor(Color.RED); }else{ v.setBackgroundColor(Color.BLUE); } v.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); v.setPadding(twoDP, twoDP, twoDP, twoDP); v.setBackgroundResource(R.drawable.tags_rounded_corners); I was hoping setting a drawable and color

UIImage with transparent rounded corners

最后都变了- 提交于 2019-11-26 16:56:19
问题 I'm using following code to add rounded corners to my UIImage, but the problem is that the rounded corners are showing "white" area instead of transparent or "clear". What am i doing wrong here: - (UIImage *)makeRoundCornerImageWithCornerWidth:(int)cornerWidth cornerHeight:(int)cornerHeight { UIImage * newImage = nil; if (self != nil) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int w = self.size.width; int h = self.size.height; CGColorSpaceRef colorSpace =

ImageView rounded corners

时光怂恿深爱的人放手 提交于 2019-11-26 15:45:50
问题 I wanted image to have rounded corners. I implement this xml code and use this in my image view. but image overlap the shape. I am downloading the image through async task. <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <corners android:radius="20dip" /> </shape> <ImageView android:id="@+id/trVouchersImage" android:layout_width="55dp" android:layout_height="55dp" android:layout_marginLeft="8dp" android