开发者

How do you show UILabel over a UIImageView (Objective-C)?

开发者 https://www.devze.com 2023-04-04 18:12 出处:网络
I am developing an iPhone app and I cannot see the UILabel I made in Interface Builder, but I can see the UIImageView I made programmatically. I am a complete noob to Objective-C so pl开发者_如何转开发

I am developing an iPhone app and I cannot see the UILabel I made in Interface Builder, but I can see the UIImageView I made programmatically. I am a complete noob to Objective-C so pl开发者_如何转开发ease tell me what I can do to fix this.


Drag you UILabel in IB to bottom of your stack subviews of view where your UIImageView is placed.

How do you show UILabel over a UIImageView (Objective-C)?


Try adding the label after the image view :

[mainView addSubview:imageView];
[mainView addSubview:label];

Also make sure the label's frame makes it visible on the screen.


Gussing that you are adding image in view where label is existing than use following code to see the label over the image view.

[self.view addSubView:yourImageViewName];
[self.view bringSubviewToFrong:yourImageViewName];


I'm not sure, but click on your xib file. On the second column on your left you'll see Object, and below there's "View" with an arrow.If you click on it(the arrow) you'll see everything you have in this View. I suppose you have Button and ImageView. They shouldn't go in this way. Change their order. If you first have Button,then ImageView, you won't see your Button,cause it's under the image.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号