How is a rounded rect view with transparency done on iphone?

前端 未结 5 1726
你的背包
你的背包 2020-11-30 17:38

A lot of apps pop up a transparent view with rounded corners and an activityIndicator when running a time consuming operation.

How is this rounding done and is it po

5条回答
  •  一向
    一向 (楼主)
    2020-11-30 18:15

    As of iPhone SDK 3.0, you can simply use the layer's cornerRadius property. E.g.:

    view.layer.cornerRadius = 10.0;
    

    Along the same lines, you can change the view's border color and width:

    view.layer.borderColor = [[UIColor grayColor] CGColor];
    view.layer.borderWidth = 1;
    

提交回复
热议问题