简体   繁体   English

在设备中运行时,不显示子视图

[英]SUbviews are not displayed when run in device

GoodMorning All!!! 大家早上好!!!

I am creating subviews of UIViews of small dimensions and adding it to the view using the statement [self.view addSubView:myview]; 我正在创建小尺寸的UIViews的子视图,并使用语句[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. 在viewDidLoad方法中,当我在模拟器中运行应用程序时,它显示创建的子视图,但是当我在设备中运行相同时,子视图不会显示。

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. 我使用的是Xcode 3.2.4,设备操作系统是4.1。

Please give me solution to this issue as soon as you people can. 一旦人们可以,请尽快给我解决这个问题。

Thank you everyone. 谢谢大家。

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. 在运行应用程序之前尝试清洁,如果仍然在模拟器上而不是在设备上显示它,则只需尝试将子视图置于最前面。

  [self.view bringSubviewToFront:your_subview];

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. 可能是您忘记将图像复制到资源文件夹或类似。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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