在设备中运行时不显示子视图
大家早上好!!!
我正在创建小尺寸 UIView 的子视图,并使用语句 [self.view addSubView:myview]; 将其添加到视图中。在 viewDidLoad 方法中,当我在模拟器中运行应用程序时,它会显示创建的子视图,但是当我在设备中运行相同的应用程序时,子视图不会显示。
我的子视图不是空的,它们上面有标签,我在模拟器上看到它们,但是当我在设备中运行相同的内容时,屏幕是空的。
我使用的是 Xcode 3.2.4,设备操作系统是 4.1。
请尽快给我解决这个问题的办法。
谢谢大家。
GoodMorning All!!!
I am creating subviews of UIViews of small dimensions and adding it to the view using the statement [self.view addSubView:myview]; in the viewDidLoad method,when i run the application in the simulator its displaying the subviews created,but when i run the same in the device the subviews are not getting displayed.
My subviews are not empty they have labels on them,i see them on the simulator ,but when i run the same in the device the screen is empty.
I am using Xcode 3.2.4 and the device OS is 4.1.
Please give me solution to this issue as soon as you people can.
Thank you everyone.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试在运行应用程序之前进行清理,如果它仍然显示在模拟器上而不是设备上,那么只需尝试将子视图置于前面。
快乐编码...
Try cleaning before running the application and if still it gets displayed on simulator and not on device then just try bringing the subviews to front.
hAPPY iCODING...
尝试设置子视图的背景颜色以确认您的视图已添加到主视图。
可能您忘记将图像复制到资源文件夹或类似的文件夹中。
Try to set background color of your subviews to confirm that your views are added to main view.
may be you have forget to copy images to the resources folder or like that.