You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, autolayout setting correct frame according to white background color, inner circleViews are resized (from 100, 100 to 41, 41 frame). But inner circles are not perfectly centered, approximately: (left: 5 top: 5, bottom: 8, right: 8), and dont have size I need (same as white circle).
Am I missing something? circularProgressView.setNeedsLayout on parent LayoutSubviews doesnt work.
Swift 5, XCode 11.3.1 (11C504)
The text was updated successfully, but these errors were encountered:
public override init(frame: CGRect) {
super.init(frame: frame)
setNeedsLayout()
layoutIfNeeded()
}
layout right after initialization cause all frames set, lazy variables initialize and calculate, even if there is no frame, and more importantly, positions calculated using initial value of lineWidth = 8 and hardcoded width and height frame.
public override init(frame: CGRect) {
super.init(frame: frame)
}
I believe this one will solve exact issue, and allows autolayout without frame using let circularProgress = KYCircularProgress().
But I dont know the initial purpose of these lines so cant say its solution
I have issue setting correct width and height for progress view.
For this code, and constrainting
circularProgressView
to5
for top, bottom, trailing and aspectRatio 1 (perfect square):I am getting following result
As you can see, autolayout setting correct frame according to white background color, inner circleViews are resized (from
100, 100
to41, 41
frame). But inner circles are not perfectly centered, approximately: (left: 5 top: 5, bottom: 8, right: 8), and dont have size I need (same as white circle).Am I missing something? circularProgressView.setNeedsLayout on parent LayoutSubviews doesnt work.
Swift 5, XCode 11.3.1 (11C504)
The text was updated successfully, but these errors were encountered: