Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS - How to display UILabel and UIImageView in landscape mode
    text
    copied!<p>I have created an UIImageView and UILabel in my AppDelegate.m file to display the title image <br>My default orientation is in landscape mode but i am not able to display the image properly it shows like the below image<img src="https://i.stack.imgur.com/ECJaK.jpg" alt="UIImage to be in landscape mode"></p> <p>The desired result should be like this image given below</p> <p><img src="https://i.stack.imgur.com/IVbPi.jpg" alt="enter image description here"></p> <p>i also tried to rotate the image and label in my <code>AppDelegate.m</code> file this is my code<br> But it dosen't display the image and title is just disappears.</p> <pre><code> - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. UIViewController *viewController1 = [[LMSFirstViewController alloc] initWithNibName:@"LMSFirstViewController" bundle:nil]; UIViewController *viewController2 = [[LMSSecondViewController alloc] initWithNibName:@"LMSSecondViewController" bundle:nil]; UIViewController *viewController3 = [[LMSThirdViewController alloc] initWithNibName:@"LMSThirdViewController" bundle:nil]; UILabel *title=[[UILabel alloc]initWithFrame:CGRectMake(50, 0, 5000, 50)]; title.text=@"Library Management System"; [title setFont:[UIFont systemFontOfSize:24]]; [title setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0]]; title.textColor=[UIColor redColor]; title.transform=CGAffineTransformMakeRotation(M_PI_2); UIImageView *imageView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 5000, 50)]; imageView.image=[UIImage imageNamed:@"LMS.jpg"]; imageView.transform=CGAffineTransformMakeRotation(M_PI_2); self.tabBarController = [[UITabBarController alloc] init]; self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2,viewController3,nil]; self.window.rootViewController = self.tabBarController; [self.window makeKeyAndVisible]; [self.window addSubview:imageView]; [self.window addSubview:title]; return YES; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload