简体   繁体   中英

How to make a circle on the LaunchScreen?

I made a Cocoa Touch Class called BlackCircle , a UILabel subview which called the drawRect() method to make a black circular label. I dragged a UILabel onto the LaunchScreen.xib file, and when I assigned the Cocoa Touch Class File as the class of the UILabel , I got an error-

"Launch Screen may not use instances of BlackCircle ".

It works fine on the main.storyboard file, but it doesn't work on the LaunchScreen.xib file. How can I fix this? Thanks!

LaunchScreen will not load your custom instances. Remember the app hasn't launched yet. Thus you cannot have custom instances.

You are only allowed to use basic UIKit classes like UIView, UIImageView, UILabel, etc.

Your best bet would be to make an image resource for the black circular label and import it to the LaunchScreen.xib

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM