logo
down
shadow

Bottom corners arent round


Bottom corners arent round

By : user2174072
Date : October 19 2020, 08:10 AM
it fixes the issue Thank you for the suggestion. Unfortunately it didnt work. I was able to fix it by doing the following: On the storyboard tree On the ViewController there is a View on the element tree. I linked that as an outlet in my code and made it's corners round. Basically I called the round corners twice: - Home View controller had:
code :
func setupViews() {
  containerTop.layer.cornerRadius = 15
  containerTop.clipToBounds = true

  containerBot.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner, .layerMinXMaxYCorner, .layerMaxXMaxYCorner]
  containerBot.layer.cornerRadius = 15
  containerBot.clipToBounds = true
}  
class ContainerTopViewController: UIViewController {
<LINKED THROUGH STORYBOARD> myView: UIViewController
func loadView() {
myView.layer.cornerRadius = 15
myView.layer.clipToBounds = true
}

}


Share : facebook icon twitter icon
Round bottom corners on Android Bitmap?

Round bottom corners on Android Bitmap?


By : user1760852
Date : March 29 2020, 07:55 AM
Hope that helps Fyi: I've found this code snippet: http://www.ruibm.com/?p=184 .
As in my case, I only wanted the bottom corners to be rounded, so I added an additional drawRect (with smaller height than the drawRoundRect) to the canvas.
How to round corners of list item at the top and bottom of the list view? (not only for top and bottom items)

How to round corners of list item at the top and bottom of the list view? (not only for top and bottom items)


By : suhaimie mazlan
Date : March 29 2020, 07:55 AM
should help you out This solution is not pretty but it does what you want. The idea is to invert the corner and draw them as foreground :
the ListView is wrapped in a FrameLayout :
code :
<FrameLayout
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_margin="10dp"
      android:foreground="@drawable/inverted_corners"
      android:layout_weight="1">
      <ListView
          android:id="@+id/listView3"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="#fff"
          android:listSelector="@drawable/list_selector" />
  </FrameLayout>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:bottom="-11dp"
        android:left="-11dp"
        android:right="-11dp"
        android:top="-11dp">
        <shape android:shape="rectangle">
            <stroke
                android:width="10dp"
                android:color="#cacaca" />
            <corners android:radius="22dp" />
        </shape>
    </item>
</layer-list>
Draw round corners on top left top right bottom left bottom right using Path and RectF in Android

Draw round corners on top left top right bottom left bottom right using Path and RectF in Android


By : Thaiane
Date : March 29 2020, 07:55 AM
wish helps you There is a Path#addRoundRect() overload that takes a float array of eight values wherein we can specify the x- and y-radius for each of the four corners. These values are in [x, y] pairs, starting at the top-left corner, and going clockwise around the rest. For those corners we want rounded, we set both values of the pair to the radius value, and leave them at zero for those we don't.
As an illustrative example, a simple method that will return a Path that can be used in your snippet:
code :
private Path getPath(float radius, boolean topLeft, boolean topRight,
                     boolean bottomRight, boolean bottomLeft) {

    final Path path = new Path();
    final float[] radii = new float[8];

    if (topLeft) {
        radii[0] = radius;
        radii[1] = radius;
    }

    if (topRight) {
        radii[2] = radius;
        radii[3] = radius;
    }

    if (bottomRight) {
        radii[4] = radius;
        radii[5] = radius;
    }

    if (bottomLeft) {
        radii[6] = radius;
        radii[7] = radius;
    }

    path.addRoundRect(new RectF(0, 0, getWidth(), getHeight()),
                      radii, Path.Direction.CW);

    return path;
}
@Override
protected void onDraw(Canvas canvas) {
    float radius = getContext().getResources().getDimension(R.dimen.round_corner_radius);
    Path path = getPath(radius, true, true, false, false);
    canvas.clipPath(path);
    super.onDraw(canvas);
}
public class RoundishImageView extends ImageView {

    public static final int CORNER_NONE = 0;
    public static final int CORNER_TOP_LEFT = 1;
    public static final int CORNER_TOP_RIGHT = 2;
    public static final int CORNER_BOTTOM_RIGHT = 4;
    public static final int CORNER_BOTTOM_LEFT = 8;
    public static final int CORNER_ALL = 15;

    private static final int[] CORNERS = {CORNER_TOP_LEFT,
                                          CORNER_TOP_RIGHT,
                                          CORNER_BOTTOM_RIGHT,
                                          CORNER_BOTTOM_LEFT};

    private final Path path = new Path();
    private int cornerRadius;
    private int roundedCorners;

    public RoundishImageView(Context context) {
        this(context, null);
    }

    public RoundishImageView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public RoundishImageView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);

        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RoundishImageView);
        cornerRadius = a.getDimensionPixelSize(R.styleable.RoundishImageView_cornerRadius, 0);
        roundedCorners = a.getInt(R.styleable.RoundishImageView_roundedCorners, CORNER_NONE);
        a.recycle();
    }

    public void setCornerRadius(int radius) {
        if (cornerRadius != radius) {
            cornerRadius = radius;
            setPath();
            invalidate();
        }
    }

    public int getCornerRadius() {
        return cornerRadius;
    }

    public void setRoundedCorners(int corners) {
        if (roundedCorners != corners) {
            roundedCorners = corners;
            setPath();
            invalidate();
        }
    }

    public boolean isCornerRounded(int corner) {
        return (roundedCorners & corner) == corner;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        if (!path.isEmpty()) {
            canvas.clipPath(path);
        }

        super.onDraw(canvas);
    }

    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        setPath();
    }

    private void setPath() {
        path.rewind();

        if (cornerRadius >= 1f && roundedCorners != CORNER_NONE) {
            final float[] radii = new float[8];

            for (int i = 0; i < 4; i++) {
                if (isCornerRounded(CORNERS[i])) {
                    radii[2 * i] = cornerRadius;
                    radii[2 * i + 1] = cornerRadius;
                }
            }

            path.addRoundRect(new RectF(0, 0, getWidth(), getHeight()),
                              radii, Path.Direction.CW);
        }
    }
}
<resources>
    <declare-styleable name="RoundishImageView">
        <attr name="cornerRadius" format="dimension" />
        <attr name="roundedCorners">
            <flag name="topLeft" value="1" />
            <flag name="topRight" value="2" />
            <flag name="bottomRight" value="4" />
            <flag name="bottomLeft" value="8" />
            <flag name="all" value="15" />
        </attr>
    </declare-styleable>
</resources>
<com.mycompany.myapp.RoundishImageView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/riv"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:scaleType="fitXY"
    android:src="@drawable/magritte"
    app:cornerRadius="@dimen/round_corner_radius"
    app:roundedCorners="topLeft|topRight" />
Bottom skewed line with background image and round corners

Bottom skewed line with background image and round corners


By : codingnewbie
Date : March 29 2020, 07:55 AM
To fix this issue Adding border-radius to parent div could work, as it will work as border-radius for four corner and then individually using border-top-right-radius, border-top-left-radius,border-bottom-right-radius,border-bottom-left-radius you can change and align accordingly as below and thus it skews at bottom-left along-with border-radius at 4 sides,
code :
.container {
  overflow: hidden;
  padding-bottom: 40px;
  border-top-right-radius:16px;
  border-bottom-right-radius:14px;
  border-top-left-radius:40px;
  margin-top:40px;
  display:inline-block;
  }

#parallelogram {
  width: 300px;
  height: 150px;
  margin: -41px 0 0 0;
  -webkit-transform: skewY(-11deg);
  -moz-transform: skewY(-11deg);
  -o-transform: skewY(-11deg);
  background: red;
  overflow: hidden;
  position: relative;
  border-radius: 40px;  
}

.image {
  background: url(http://baconmockup.com/340/500);
  position: absolute;
  top: -30px;
  left: -30px;
  right: -30px;
  bottom: -30px;
  -webkit-transform: skewY(11deg);
  -moz-transform: skewY(11deg);
  -o-transform: skewY(11deg);
  
}
<div class="container">
  <div id="parallelogram">
    <div class="image"></div>
  </div>
</div>
Round UIView bottom corners inside custom UITableViewCell

Round UIView bottom corners inside custom UITableViewCell


By : user1981255
Date : March 29 2020, 07:55 AM
like below fixes the issue Your code for adding a CAShapeLayer as your view's mask layer is quite close. This line:
code :
shapeLayer.frame = bottomDetailsView.frame
shapeLayer.frame = bottomDetailsView.bounds
class RoundedBottomCornersView: UIView {
    var shapeLayer: CAShapeLayer!

    //If the view's bounds change, update the shapeLayer's frame and also rebuild the path
    override var bounds: CGRect {
        didSet {
            shapeLayer.frame = self.bounds
            createShapeLayerPath()
        }
    }

    func createShapeLayerPath() {
        let path = UIBezierPath(roundedRect: bounds,
                                byRoundingCorners: [.bottomLeft, .bottomRight],
                                cornerRadii: CGSize(width: 15, height: 15))
        shapeLayer.path = path.cgPath
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        layer.borderWidth = 1.0

        shapeLayer = CAShapeLayer()
        shapeLayer.frame = bounds
        layer.backgroundColor = UIColor.red.cgColor
        layer.mask = shapeLayer
    }
}
Related Posts Related Posts :
  • Inserting into Array and comparing Dates Swift iOS Code
  • IBDesignable UI is not showing in Xcode 9 with Swift
  • Ask for only Request Always Authorization, and not When-In-Use Authorization
  • "Google/Analytics.h file not found" after updating pod to GoogleAnalytics
  • Post request with HTTP header parameters
  • Managing cookies for a domain in Associated Domains
  • Array items showing error in IOS
  • Saving asynchronously downloaded files' contents to SQLITE
  • Swift 4 - animating both alpha and constraint affects other components alpha value
  • UIView animation in completion block starts with displacement
  • List all Apps and Track Internet Usage
  • Handling Back To Back HTTP Posts SWIFT 4.0
  • Azure App Service Push - registration endpoint
  • Select multiple item in a tableView
  • Apartment number / Unit number returned from google places api
  • How to align UICollectionViewCells from left to right?
  • How can I add search option on UIPickerview in ios?
  • Scenekit - physicsWorld setup to prevent kinematic nodes to intersect
  • Carthage Build Failed
  • swift 3, ios 10 - push notification firebase is not received
  • App Xcode 8 to Xcode 9 - Prevent Auto Hide Status Bar
  • How to pop back to a TableViewController?
  • Is UserDefaults thread safe in Swift? How to check it?
  • UISwitch in a table selects multiple cells when switch state on
  • iOS App with no story board (Size classes and Device type limitations)
  • AudioKit issue, mic not sensitive enough
  • send indexpath to Firebase (like button)
  • UIColor saturation brightness values different from the regular saturation luminosity values of a color
  • JSON: Extracting Data Using Alamofire and Swift 3
  • invalid_grant on OAuth2 request when obtaining access_token from SSO in App
  • ABNewPersonViewController using contact framework
  • Design iOS button scalable
  • Subclassing NSLayoutConstraint constant based on screen height
  • Migrate Realm 2.x List of Object to Realm 3.x List of String (or other primary type)
  • Using BLE RSSI value for connect-by-proximity
  • Backgroundcolor of NSTextfield
  • Firebase modifying uid in every view
  • How to rotate orientation?
  • Upload a new version of ios app to app store?
  • UIScrollView do not scroll down to its original position when keyboard disappear
  • What is the most effective way of tracking time/dates in an iOS/Swift application?
  • WatchKit get user's preferred handedness
  • Location permission dialog is shown and immediately disappears
  • Combine these regex expressions
  • How to save an array of HKQuantitySamples (heart rate) to a workout
  • RestKit mapping with parent key as attribute and key contains parenthesis
  • How to add UITextField programmatically to UIScrollView without breaking constraints?
  • How to make a view height grow depending on its child views contents
  • Some users experiencing NSInternalInconsistencyException crash
  • Mark successful siesta response as error
  • Using a modified PDFTron Tools Framework
  • How can I use universal links when I call openURL inside my own app?
  • NSArray of doubles iOS (Objective c)
  • Passing data from embedded PageViewController to parent View Controller
  • Reuse item inside a row when scrolling
  • Realm Relation how to implement
  • error: generic parameter 'T' could not be inferred in swift
  • Adding shadow to UITextView makes text expand out of UITextViewFrame
  • How to change the string in seconds to minutes in Swift3?
  • Search bar is refreshing the index of my table view cell
  • shadow
    Privacy Policy - Terms - Contact Us © voile276.org