UIView landscape only



Share on Google+Share on Google+

Deepak Kumar
UIView landscape only
1 Answer(s)      6 years and 9 months ago
Posted in : MobileApplications


How to display your view in landscape orientation only?


View Answers

December 21, 2010 at 10:16 PM


You use the following code in your view controller class:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Overriden to allow any orientation.
    //return YES;
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);



Related Tutorials/Questions & Answers:
UIView landscape only
UIView landscape only  HI, How to display your view in landscape orientation only? Thanks   Hi, You use the following code in your view controller class: - (BOOL)shouldAutorotateToInterfaceOrientation
landscape orientation iPad
landscape orientation iPad   In my iPad application, i want to change the orientation as landscape only.. how could i be done? Currently i'm using... to landscape only ... either comment or delete the "return YES" and instead of it write
Creating UIView Programmatically
to it.. the only difference is that prior, we were loading the UIView that already...Creating UIView Programmatically The example will show you how to create a UIView programmatically. In the previous example, we have illustrated you how
how printing landscape?
how printing landscape?  I have code which print some data from data... "Print Dialog", but it does not work if chose "Landscape". Is any way to print LANDSCAPE
uiview alloc initwithframe
uiview alloc initwithframe  Hi, How I can make uiview programmatically? Tell me good code for UIView alloc using initwithframe method. Thanks   Hi, You can use following code: UIView *modalView = [[[UIView alloc
changing uiview background color
changing uiview background color  changing UIView background color in ios   self.view.backgroundColor = [UIColor colorWithRed:244.0f/255.0f green:230.0f/255.0f blue:183.0f/255.0f alpha:1.0f
UIView Background Image
UIView Background Image  HI, Please let's know how to add background image to a view? Thanks   Hi You can use the following code...:@"myimage.png"]]; Read more at UIView Image Background Tutorial page. Thanks
pdf landscape
pdf landscape       In this free tutorial we are going to tell you about landscape portrait in iText... you will know more about the landscape portrait.  To make a program over
add imageview to uiview
add imageview to uiview  i want to add an image to UIView background.   self.view.backgroundColor = [UIColor colorWithPatternImage... to UIView Add an Image or Image URL to your ImageView. Code: UIImageView
how to get UIView by tag
how to get UIView by tag  In IOS application how to get a view by the tag id? Thanks   Hi, You can get this with the help of the function... view: for (UIView *i in self.view.subviews){ if([i isKindOfClass:[UILabel
UIView Access Subviews
UIView Access Subviews In the example, you'll learn how to create and access a subview on UIView. Syntax of adding subview at UIView. - (void)addSubview:(UIView *)view; Creating and accessing a subview : In the example we
Rotating UIViewController
to rotate your UIView into both portrait or landscape orientation. Steps for Rotating UIViewController in both portrait and landscape orientation. -> Create... you will find that it's opening into the portrait mode only. To enable
iPhone landscape mode
iPhone landscape mode In this series of iPhone application development tutorial, you'll learn launching your iPhone app in landscape mode. Believe me it's very simple to change your iphone app in landscape mode. Just follow
UIView frame x,y width and height
UIView frame x,y width and height  HI, How to print the x,y width and height of UIView? Thanks   Hi, Following code can be used: CGRect myFrame = myview_.frame; NSLog(@"height = %f", myFrame.size.height); NSLog
UIView Image Background
UIView Image Background In this tutorial, we are going to show you how to add image at background in UIView. There are two different ways of adding background image in your iphone application.. 1. Either you can set the UIView
Digit Only text field
Digit Only text field  How should we accept digits only in a textbox? (using JSTL only, without Javascript
Only Display Date
Only Display Date  I want to implement only date not time like that 20 Sep 2011. How can possiple it?   Your question is not clear. Which technology you use? java/.NET/SQl
mysqldump structure only
only? Provide me the syntax to take mysqldump structure only. Thanks   Hi, You can use -d option with mysqldump command to take the structure only... to dumb only tables definitons , not the data ? use ?d command? if path is not set
Works only for one row
Works only for one row   Hi, My below code is working only if there is a single row. could you please help me in doing it for all the rows retrieved from the database. <[email protected] import="java.util.concurrent.CountDownLatch
display:table export only data
display:table export only data  I am using display:table tag with attribute export="true". Using that I can export table data in excel. Here one of the column is in hyper link. But i need to export only data not html tag . Can
Allow to Enter only numeric data.
Allow to Enter only numeric data.  hi....... I want to ask... that the user should allow to enter only numeric data. I mean to say that if user... that enter only numeric data. So how this can be done? what will be the code
Orientation iPhone SDK
to support only landscape mode then either you can change it from .plist by adding... please keep in mind that landscape orientation is not possible in the case... is changed from portrait to landscape. But certainly it's possible in navigation
upload the pdf file only - Struts
upload the pdf file only  plz tell me,in my web application i want to upload only pdf file.but i m getting the problem when anyone change the extesion of EXE or TEXT with .pdf its also upload.plz give me response ASAP plz
list files only - Java Beginners
list files only  i have to list only files and number of files in a directory? i use list() method but it returns both files and directories in parent directory.are there any specific methods that show only files? are file
how to get only checked data
how to get only checked data  my problem is that i have a jsp page on which i retrieve data from the database through servlet , on the jsp page... button it should redirect only checked data to other jsp page which is connected
upload only pdf file - Struts
upload only pdf file  in web application,i want to attach only pdf file but if i change the extension of EXE or TXT files with PDF Extension its also upload ,but i want to upload only pdf file not only the extesion but also
Mysql Date Part Only
Mysql Date Part Only       Sometimes we want to see the date part only from the records of a table. The Tutorial covers you an example that helps you to get date part. The date(now
Solve using only Javascript loops...
Solve using only Javascript loops...  Write a JavaScript code, 1) to find a number of unique letters in string. (Eg. if keyword is unique, Unique count will be '4') 2) so that numbers appear in following format, 1 1 2
Making a Collection Read-Only
Making a Collection Read-Only       This section describes you how to make a collection read-only... for making it read-only. By default, list is not read-only. If the list is read-only
Textbox allows only numbers in java wicket
Textbox allows only numbers in java wicket  Please provide me wicket code for text box that allows only numbers to type. Thank you
Mysql Time Only
Mysql Time Only       Mysql Time Only is used to return the current time on your current local system...) Query to find time only:- The below Query time(now ( )) return you