How to round specific corners of a View?

Demo (Source code is available at the end of the post) iOS 16+ built-in modifier (Xcode 15 needed) Clip the view using the new UnevenRoundedRectangle: .clipShape( .rect( topLeadingRadius: 0, bottomLeadingRadius: 20, bottomTrailingRadius: 0, topTrailingRadius: 20 ) ) ⚠️ Note: Although it works from iOS 16, .rect needs Xcode 15 to be available. iOS 13+ You … Read more

How to change card_view:cardCornerRadius programmatically

Use CardView.setRadius(float), see androidx.cardview. (It is worth noting that this will have no effect if you also invoke setBackgroundColor, make sure to use setCardBackgroundColor instead). You must specify a pixel size, rather than dp value, e.g. for corner radius of 4dp you can invoke, in Kotlin: radius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4f, context.resources.displayMetrics)

How to add a border/corner radius to a LinearProgressIndicator in Flutter?

1) Using Widget Container( margin: EdgeInsets.symmetric(vertical: 20), width: 300, height: 20, child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(10)), child: LinearProgressIndicator( value: 0.7, valueColor: AlwaysStoppedAnimation<Color>(Color(0xff00ff00)), backgroundColor: Color(0xffD6D6D6), ), ), ) 2) Using dependency List of different types indicator https://pub.dev/packages/percent_indicator Try this template code child: Padding( padding: EdgeInsets.all(15.0), child: LinearPercentIndicator( width: MediaQuery.of(context).size.width – 50, animation: true, lineHeight: 20.0, animationDuration: 2000, … Read more

set cornerRadius and setbackgroundimage to UIButton

Here is how I would create a button through code and set its background color. UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(100, 100, 100,50); [btn setTitle:@”Hello” forState:UIControlStateNormal]; [btn setBackgroundColor:[UIColor colorWithRed:128.0/255.0f green:0.0/255.0f blue:0.0/255.0f alpha:0.7]]; btn.frame = CGRectMake(100.0, 100.0, 120.0, 50.0);//width and height should be same value btn.clipsToBounds = YES; btn.layer.cornerRadius = 20;//half of the width … Read more

tech