Round Top Corners of a UIButton in Swift

Swift 4: For latest iOS 11 onwards override func viewDidLoad() { super.viewDidLoad() if #available(iOS 11.0, *) { self.viewToRound.clipsToBounds = true viewToRound.layer.cornerRadius = 20 viewToRound.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] } else { // Fallback on earlier versions } } Earlier iOS (10,9 etc) Versions (works for iOS 11 too) override func viewDidLayoutSubviews() { self.viewToRound.clipsToBounds = true let … Read more

svg / d3.js rounded corners on one side of a rectangle

Expanding on @robert-longson’s answer, you can use SVG’s elliptical arc commands to make the corners, in conjunction with lineto commands for the straight edges. These are used with path elements. Here’s one possible implementation: // Returns path data for a rectangle with rounded right corners. // The top-left corner is ⟨x,y⟩. function rightRoundedRect(x, y, width, … Read more

Bitmap in ImageView with rounded corners

try this one : public class CustomImageView extends ImageView { public static float radius = 18.0f; public CustomImageView(Context context) { super(context); } public CustomImageView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onDraw(Canvas canvas) { //float radius = 36.0f; Path clipPath … Read more

WPF rounded corner textbox

@Smolla had a much better answer in his comment on @Daniel Casserly’s answer: <TextBox Text=”TextBox with CornerRadius”> <TextBox.Resources> <Style TargetType=”{x:Type Border}”> <Setter Property=”CornerRadius” Value=”3″/> </Style> </TextBox.Resources> </TextBox> If you want all the borders of TextBoxes and ListBoxes to have rounded corners, put the style into your Window’s or App’s <Resources>.

Rounded Corners only on Top of a UIView

You can do this by setting a mask on your view’s layer: CAShapeLayer * maskLayer = [CAShapeLayer layer]; maskLayer.path = [UIBezierPath bezierPathWithRoundedRect: self.bounds byRoundingCorners: UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii: (CGSize){10.0, 10.}].CGPath; self.layer.mask = maskLayer; IMPORTANT: You should do this in your view’s layoutSubviews() method, so the view has already been resized from the storyboard In Swift … Read more

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

Inner border calculations First, you’ll need to remove -vendor-background-clip: padding-box or set them to border-box the default in order to achieve the inner border radius. The inner border radius is calculated as the difference of the outer border radius (border-radius) and the border width (border-width) such that inner border radius = outer border radius – … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)