logo
Tags down

shadow

Animate UIImageView start from rounded topRight corner and end with Rectangle


By : Radhakishan R. Surwa
Date : October 17 2020, 06:10 AM
Any of those help take a look at this solution right here, it works from iOS 11 and above
code :
if #available(iOS 11, *) {

        roundedView.layer.maskedCorners = [.layerMaxXMinYCorner]
        self.roundedView.layer.cornerRadius = 20

        UIView.animate(withDuration: 2, animations: {
            self.roundedView.layer.cornerRadius = 0
        }, completion: nil )

    }


Share : facebook icon twitter icon

rounded corner in UIImageView


By : user3127299
Date : March 29 2020, 07:55 AM
seems to work fine I have the following code: , setMasksToBounds is probably what you are looking for.
code :
[avatar.layer setMasksToBounds:YES];

How to make a rounded corner rectangle with a cut corner using css?


By : Artem Vasilenko
Date : March 29 2020, 07:55 AM
To fix the issue you can do Pure CSS Solution
Here's the jsFiddle example with comparison to original image and the CSS:
code :
span.tag {
 margin:4px 5px;
 position:relative;
 border-radius:5px;
 background:red;
 display:inline-block;
 padding:.6em 4.5em;
 text-align:center;
}
span.tag-gray {
 background: #7c7d80; /* Old browsers */
 background: -moz-linear-gradient(top, #7c7d80 0%, #7c7d80 50%, #66686b 51%, #66686b 100%); /* FF3.6+ */
 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7c7d80), color-stop(50%,#7c7d80), color-stop(51%,#66686b), color-stop(100%,#66686b)); /* Chrome,Safari4+ */
 background: -webkit-linear-gradient(top, #7c7d80 0%,#7c7d80 50%,#66686b 51%,#66686b 100%); /* Chrome10+,Safari5.1+ */
 background: -o-linear-gradient(top, #7c7d80 0%,#7c7d80 50%,#66686b 51%,#66686b 100%); /* Opera 11.10+ */
 background: -ms-linear-gradient(top, #7c7d80 0%,#7c7d80 50%,#66686b 51%,#66686b 100%); /* IE10+ */
 background: linear-gradient(top, #7c7d80 0%,#7c7d80 50%,#66686b 51%,#66686b 100%); /* W3C */
 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7c7d80', endColorstr='#66686b',GradientType=0 ); /* IE6-9 */
 color:#fff;
 font-family:sans-serif;
 font-size:.7em;
 font-weight:bold;
}
span.tag:after {
 /* right, height, and width should equal eachother */
 right:-18px;
 height:18px;
 width:18px;
 content:".";
 display:block;
 position:absolute;
 top:0;
 font-size:0;
 overflow:hidden;
 background:#fff;
 -moz-transform-origin:0 0;
 -moz-transform:rotate(-45deg) translate(-50%, -50%);
 -webkit-transform-origin:0 0;
 -webkit-transform:rotate(-45deg) translate(-50%, -50%);
 transform-origin:0 0;
 transform:rotate(-45deg) translate(-50%, -50%);
}
<span class="tag tag-gray">FRETE GRÁTIS</span>

svg / d3.js rounded corner on one corner of a rectangle


By : fitian
Date : March 29 2020, 07:55 AM
I hope this helps . 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:
code :
// Returns path data for a rectangle with rounded right corners.
// The top-left corner is ⟨x,y⟩.
function rightRoundedRect(x, y, width, height, radius) {
  return "M" + x + "," + y
       + "h" + (width - radius)
       + "a" + radius + "," + radius + " 0 0 1 " + radius + "," + radius
       + "v" + (height - 2 * radius)
       + "a" + radius + "," + radius + " 0 0 1 " + -radius + "," + radius
       + "h" + (radius - width)
       + "z";
}
rects.enter().append("path")
    .attr("d", function(d) {
      return rightRoundedRect(x(0), y(d.name), x(d.value) - x(0), y.rangeBand(), 10);
    });
rects.enter().append("path")
    .attr("d", rightRoundedRect()
      .x(x(0))
      .y(function(d) { return y(d.name); })
      .width(function(d) { return x(d.value) - x(0); })
      .height(y.rangeBand())
      .radius(10));

UIimageView rounded top corner BezierPath not working?


By : Maha Ibrahim
Date : March 29 2020, 07:55 AM
like below fixes the issue I'm try to round the top two corner of a uiimageview but the following code doesn't show rounded corner only the normal image. Am I missing something? Thx , This works for me
code :
- (void)viewDidLoad
    {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

//Just to add contrast
[self.view setBackgroundColor:[UIColor blackColor]];

UIImage * image = [UIImage imageNamed:@"logo3w.png"];
UIImageView * imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 328)];
imgView.contentMode = UIViewContentModeScaleAspectFill;
imgView.image = image;
// Add the imageView to your view heirarchy, UITableViewCell or otherwise
[self.view addSubview:imgView];

CAShapeLayer * shapeLayer = [CAShapeLayer layer];
//Setting the background color of the masking shape layer to clear color is key
//otherwise it would mask everything 
shapeLayer.backgroundColor = [UIColor clearColor].CGColor;
    shapeLayer.path = [UIBezierPath bezierPathWithRoundedRect:imgView.bounds byRoundingCorners: UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(20.0, 20.0)].CGPath;

imgView.layer.masksToBounds = YES;
imgView.layer.mask = shapeLayer;
//Be sure to set the frame of the maskingLayer to be the bounds of the layer you want to   mask
shapeLayer.frame = imgView.layer.bounds;

//    self.profilePictureView had never been assigned imgView what we want to mask
//    self.profilePictureView.layer.mask = shapeLayer.mask;
//    self.profilePictureView.layer.masksToBounds = YES;

//    [cell.contentView addSubview:self.profilePictureView];
//    cell.contentView.backgroundColor = [UIColor clearColor];
}

How to set rounded corner for Uiimageview in Collectionview cell


By : GTnKY
Date : March 29 2020, 07:55 AM
To fix this issue I am trying to make a UICollectionviewCell as per the following design , You need to set imageView layer corner radius:-
Related Posts Related Posts :
  • How to build and use C library in iOS project?
  • UICollectionView cell spacing for both portrait and landscape
  • How to capture cell data from UITableView with multiple cell prototypes?
  • Swift run multiple block of codes asynchronously in background thread in order
  • how do I trigger the click event on AVRoutePickerView using swift
  • Xamarin.iOS binding for a swift library
  • Converting JSON String to Dictionary<String, Any> serializes Boolean as Int
  • How to keep tableFooterView always on bottom of UITableView
  • Why not getting response from one URL?
  • Why might my iOS app be stuck on splash screen for Apple reviewers but not for me?
  • Installing .ipa over the air does not open
  • How to Add Business Logic in CollectionView?
  • is there a shortcut to know, when I'm running my app, which view controller am I in?
  • error: Unable to load contents of file list: '/Target Support Files/Pods-xx/Pods-xx-frameworks-Debug-input-files.xcfilel
  • Encode and Decode a Class in ios
  • How to get device token using firebase?
  • Removing duplicate objects from fetch based on object parameter UPDATED Swift
  • Class variable assignment is not working inside a Alamofire request block
  • Is it possible to do Augmented Faces on iOS with ARCore?
  • How to differentiate between event saved through my app and event saved by using calendar app using EventKit?
  • Pushing Firebase events To a Table View
  • What happens to local files on iOS when the app is updated?
  • How to make a variable accessible from a different swift file?
  • I want to generate QR Code encrypted in such a way that it is only read by own QRScanner app
  • Update Phone Number in Firebase Authentication - Swift
  • Convert bits per second (bps) to a human readable size format
  • How to not invalidate observer when binding is disposed in RxSwift?
  • What happen if I return false in didFinishLaunchingWithOptions?
  • How to detect hand palm and its orientation (like facing outwards)?
  • New OutputDeviceUID is nil msg when instantiating MPVolumeView
  • How to add sound feedback like pickerview in collectionview?
  • Cannot assign value of type '[String]' to type 'String?'
  • How do I make an iOS app support iPhone 6, without supporting iPhone 5S?
  • iOS app -- no cellular access to our domain on some devices
  • How to show image from url in ios swift
  • Importing image from photo library into an app in xcode
  • Delegate won't work using three view controllers
  • Why can such code be compiled? Call popToRootViewControllerAnimated in iOS UIViewController?
  • Open native UIViewController in Flutter
  • How to place 3D object (.scn file) on detected vertical plane which should be parallel to plane in ARKIt?
  • Delegate data from one UIViewController to another one
  • WARNING: The advertisement key 'Service Data' is not allowed
  • How do I check if a particular app is installed on the user's device on iOS?
  • How to check if user has paid for an Auto Renewal Subscription In App Purchase in Swift
  • Dynamic-height UICollectionView inside a dynamic-height UITableViewCell
  • This iPhone 7 (Model 1660, 1778, 1779, 1780) is running iOS 12.3.1 (16F203), which may not be supported by this version
  • How to fix issue: no rule to process file /FBSDKCoreKit.modulemap' of type 'sourcecode.module-map' for architecture x86_
  • Apple iOS Inapp purchase Server to Server Notifications' 'Cancel' notification cases?
  • Cannot assign to property 'observationTime' is a get-only property
  • How do I use Codable to decode json response which has changing keys?
  • Saving an array in Swift
  • Swift pushViewController Works on iPad but not iPhone
  • Parsing JSON response into a struct
  • How to change dictionary keys only? Without change values swift
  • losing image quality while converting base 64
  • Trying to initialize an Image
  • Array of Integers to Arrays of Ranges
  • in iOS how to reopen application when application is in background state?
  • how to make webview not full size on screen
  • Going back to previous View Controller and Updating its data
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk