Search Results

Search found 935 results on 38 pages for 'landscape portrait'.

Page 11/38 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • SEO for images: can I use a different (cookieless) domain?

    - by Oliver
    Hello, We want to increase the value of some of our important images by means of SEO, and we want to start serving them from a different, i.e. cookieless, domain. We want to go from http://www.example.com/images/1234.jpg to http://www.example.com/germany/bavaria/landscape.jpg which can easily be done via URL rewriting. Then on the other hand, we would like to serve the image from a completely different domain, let's say http://www.examplestatic.com/germany/bavaria/landscape.jpg, to save the overhead of sending the cookie from www.example.com. Somehow I feel that this is not a good idea because I move the image away from the content by putting it on a different domain. Can anyone shed some light on this problem? Naturally, I would just use a different subdomain, e.g. img.example.com, but we already use subdomains for languages and our cookies are valid for all subdomains of example.com, so this won't help. I'd really appreciate any hints. Cheers,

    Read the article

  • ListView: convertView / holder getting confused

    - by Steve H
    I'm working with a ListView, trying to get the convertView / referenceHolder optimisation to work properly but it's giving me trouble. (This is the system where you store the R.id.xxx pointers in as a tag for each View to avoid having to call findViewById). I have a ListView populated with simple rows of an ImageView and some text, but the ImageView can be formatted either for portrait-sized images (tall and narrow) or landscape-sized images (short and wide). It's adjusting this formatting for each row which isn't working as I had hoped. The basic system is that to begin with, it inflates the layout for each row and sets the ImageView's settings based on the data, and includes an int denoting the orientation in the tag containing the R.id.xxx values. Then when it starts reusing convertViews, it checks this saved orientation against the orientation of the new row. The theory then is that if the orientation is the same, then the ImageView should already be set up correctly. If it isn't, then it sets the parameters for the ImageView as appropriate and updates the tag. However, I found that it was somehow getting confused; sometimes the tag would get out of sync with the orientation of the ImageView. For example, the tag would still say portrait, but the actual ImageView would still be in landscape layout. I couldn't find a pattern to how or when this happened; it wasn't consistent by orientation, position in the list or speed of scrolling. I can solve the problem by simply removing the check about convertView's orientation and simply always set the ImageView's parameters, but that seems to defeat the purpose of this optimisation. Can anyone see what I've done wrong in the code below? static LinearLayout.LayoutParams layoutParams; (...) public View getView(int position, View convertView, ViewGroup parent){ ReferenceHolder holder; if (convertView == null){ convertView = inflater.inflate(R.layout.pick_image_row, null); holder = new ReferenceHolder(); holder.getIdsAndSetTag(convertView, position); if (data[position][ORIENTATION] == LANDSCAPE) { // Layout defaults to portrait settings, so ImageView size needs adjusting. // layoutParams is modified here, with specific values for width, height, margins etc holder.image.setLayoutParams(layoutParams); } holder.orientation = data[position][ORIENTATION]; } else { holder = (ReferenceHolder) convertView.getTag(); if (holder.orientation != data[position][ORIENTATION]){ //This is the key if statement for my question switch (image[position][ORIENTATION]) { case PORTRAIT: // layoutParams is reset to the Portrait settings holder.orientation = data[position][ORIENTATION]; break; case LANDSCAPE: // layoutParams is reset to the Landscape settings holder.orientation = data[position][ORIENTATION]; break; } holder.image.setLayoutParams(layoutParams); } } // and the row's image and text is set here, using holder.image.xxx // and holder.text.xxx return convertView; } static class ReferenceHolder { ImageView image; TextView text; int orientation; void getIdsAndSetTag(View v, int position){ image = (ImageView) v.findViewById(R.id.pickImageImage); text = (TextView) v.findViewById(R.id.pickImageText); orientation = data[position][ORIENTATION]; v.setTag(this); } } Thanks!

    Read the article

  • Trouble with datasource not being called from viewWillAppear

    - by user278859
    A little background. I have taken GCCalendar which only works in portrait orientation and extended it to work in landscape similar to how the iPhone's Calendar app works. I did this by duplicating the main view class and modifying it to work in landscape. So when the phone is in portrait orientation the CGCalendar is instantiated from the apps main view controller using the original portrait view class and when in landscape orientation using the new modified landscape view class. Most of the other classes in GCCalendar are shared without modification. A few had to be duplicated as well. I got it all working great except for an issue with the datasource. The datasource is called when the calendar is first loaded and each time the user changes the dates being viewed. Problem is I can't get the datasource call to work on the first call. I am stumped as it works fine in portrait orientation and I cannot find any difference between the 2 versions. Following is some of the code that shows how it gets to the datasource call the first time. Subsequent calls removes all the calendar subviews and instantiates them again with the new dates. The duplicated landscape class names end in LS. Otherwise as you can see they are identical. Does anyone has any idea of where else I might look to resolve this issue? Thanks, John -------------------------------- //App main view controller - (void)showLandscapeCalendar { GCCalendarLandscapeView *calendar = [[[GCCalendarLandscapeView alloc] init] autorelease]; calendar.dataSource = self; calendar.delegate = self; navigationController = [[UINavigationController alloc] initWithRootViewController:calendar]; [self presentModalViewController:navigationController animated:YES]; } - (void)showPortraitCalendar { GCCalendarPortraitView *calendar = [[[GCCalendarPortraitView alloc] init] autorelease]; calendar.dataSource = self; calendar.delegate = self; navigationController = [[UINavigationController alloc] initWithRootViewController:calendar]; [self presentModalViewController:navigationController animated:YES]; } - (NSArray *)calendarEventsForDate:(NSDate *)date{ //build and return the events array //this is the protocol datasource method //It is supposed to run every time the date changes in the calendar } ------------------------------- // GCCalendarLandscapeView... - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (viewDirty) { [self reloadDayAnimated:NO context:NULL]; viewDirty = NO; } viewVisible = YES; } - (void)reloadDayAnimated:(BOOL)animated context:(void *)context { GCCalendarDayViewLS *nextDayView = [[GCCalendarDayViewLS alloc] initWithCalendarView:self]; } ------------------------------- //GCCalendarDayViewLS - (id)initWithCalendarView:(GCCalendarView *)view { if (self = [super init]) { dataSource = view.dataSource; } return self; } - (void)reloadData { //** first time through the dataSource method does not run events = [dataSource calendarEventsForDate:date]; } ------------------------------- // GCCalendarPortraitView... - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (viewDirty) { [self reloadDayAnimated:NO context:NULL]; viewDirty = NO; } viewVisible = YES; } - (void)reloadDayAnimated:(BOOL)animated context:(void *)context { GCCalendarDayView *nextDayView = [[GCCalendarDayView alloc] initWithCalendarView:self]; } ------------------------------- //GCCalendarDayView - (id)initWithCalendarView:(GCCalendarView *)view { if (self = [super init]) { dataSource = view.dataSource; } return self; } - (void)reloadData { **//this one works every time events = [dataSource calendarEventsForDate:date]; }

    Read the article

  • setting something disposed or invisible java

    - by OVERTONE
    this might be simple enough as just inserting the right method but i cant seem to get it right. i have a simple program with two buttons. each one changes the picture above them. but anytime i click the buttons i get some odd awt event queue error. i think its because im trying to add something to a frame after its already been made. package icnon; import javax.imageio.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class FrameIconExample extends JFrame implements ActionListener { JLabel j; JPanel p, l, k; JButton picOne, picTwo; Container cPane; public FrameIconExample() { JButton picOne = new JButton("picOne"); JButton picTwo = new JButton("picTwo"); picOne.setName("picOne"); picTwo.setName("picTwo"); picOne.addActionListener(this); picTwo.addActionListener(this); JPanel p = new JPanel(new GridLayout(2, 1)); JPanel l = new JPanel(new FlowLayout()); JPanel k = new JPanel(new FlowLayout()); cPane = getContentPane(); j = new JLabel(new ImageIcon("../meet/src/images/beautiful-closeup-portrait-photography.jpg")); l.add(j); k.add(picOne); k.add(picTwo); p.add(l); p.add(k); add(p); } public static void main(String[] args) { FrameIconExample frame = new FrameIconExample(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(new Dimension(300, 800)); frame.setTitle("Frame Icon Example"); // Display the form frame.setVisible(true); } @Override public void actionPerformed(ActionEvent e) { JButton temp = (JButton) e.getSource(); String src = "../meet/src/images/Majken Kruse portrait - john.jpg"; //System.out.println(src + " " + temp.getName()); if(temp.getName().equalsIgnoreCase("picOne")) { src = "../meet/src/images/beautiful-closeup-portrait-photography.jpg"; System.out.println(src + " " + temp.getName()); Icon img; j = new JLabel(new ImageIcon(src)); l.add(j); System.out.println("1"); } if(temp.getName().equalsIgnoreCase("picTwo")) { src = "../icontest/images/Majken Kruse portrait - john.jpg"; System.out.println(src + " " + temp.getName()); Icon img; j = new JLabel(new ImageIcon(src)); l.add(j); System.out.println("2"); } } } its all just the one program so if you copy paste it into an editor you can see the stack trace. but the source of the image files wont be there. does anyone know how id do it? or where im goin wrong? stack trace: ../meet/src/images/beautiful-closeup-portrait-photography.jpg picOne Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at icnon.FrameIconExample.actionPerformed(FrameIconExample.java:68) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

    Read the article

  • iPad: Tables in Popover Views do not Scroll to Show Selected Row

    - by mahboudz
    I am having two problems with viewcontrollerss in landscape orientation on the iPad. (1) I have two popups which hold tables. The tables should scroll to a specific row to reflect a selection in the main view. Instead, the tables do scroll down some but the actual selected row remains off screen. (2) All my action sheets come up with a width of 320. In Interface Builder, all my views are created in landscape orientation. Only the main Window is not, but I don't see a way to change that. My Configuration: Upon launch, I get the following coordinates for my main window and the main viewcontroller view: Window frame {{0, 0}, {768, 1024}} mainView frame {{0, 0}, {748, 1024}} All other views after that show these coordinates when summoned (when loaded but before being presented): frame of keysig {{0, 0}, {1024, 768}} frame of instrumentSelect {{20, 0}, {1024, 768}} frame of settings {{0, 0}, {467, 300}} In all my viewControllers, i respond to shouldAutorotateToInterfaceOrientation with: return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight)); Everything (almost) functions as expected. The app launches into one of the two landscape modes. The views (and viewcontrollers) display everything where it belongs and taps work all across the screen as expected. However, I still have the two problems. Problem 1: I have two popups containing tables long enough to run off screen. The tables should scroll to a selected row. They do scroll i.e. they don't start visually at row 1 but they don't scroll enough to actually show the selected row. It almost seems like a UITable internal rect gets created with the wrong number and stays that way but I've checked both of the UITableView's scrollView content coordinates and they seemed reasonable. Problem 2: I think this is related to problem 1 because my actionsheets come up with a width of 320. I can only assume that the iPad allows actionSheets in only 320 or 480 widths and since it somehow thinks that the screen is oriented in portrait mode, it uses the narrower width. There you have it. I can't believe I am still getting hung up on orientation issues. I swear Apple doesn't make it easy to have a landscape app. Any ideas?

    Read the article

  • programmatically change device orientation in iphone

    - by iPhoneDev
    I have navigation based app, when I click on any row in root view, the next view should come in Landscape mode. I am not able to find a proper way to implement this. What I tried is: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return UIInterfaceOrientationIsLandscape(interfaceOrientation); } But this is not working. The view should open only in Landscape mode (not when user rotate it). Can any one help me. Thanks

    Read the article

  • Home screen widget size for large screen or hdpi?

    - by kknight
    From Android widget screen guidelines, http://developer.android.com/guide/practices/ui_guidelines/widget_design.html, we know that, home screen has 4*4 cells, and in portrait orientation, each cell is 80 pixels wide by 100 pixels tall. I think these are for baseline HVGA screen. How about for large screens and hdpi screens, do they still have 4*4 cells for widget and each cell in portrait orientation is still 80 pixels * 100 pixels? Thanks.

    Read the article

  • admob orientation problem in android

    - by Aswan
    Hi folks my application integrated with admob ads.when i change the orientation it should fit the screen depends on orientation.portrait mode it is working fine when i changed to landscape mode what ad size i am getting in portrait mode same size of ad displayed in landscape mode the following i am adding in layout page <com.admob.android.ads.AdView android:id="@+id/ad" android:layout_width="fill_parent" android:layout_height="wrap_content" myapp:backgroundColor="#000000" myapp:primaryTextColor="#FFFFFF" myapp:secondaryTextColor="#CCCCCC" />

    Read the article

  • Help - Getting wrong orientation

    - by barbgal
    Hi all, I am having one issue in my application which drives me mad... In my application, i rotate the simulator to the landscape mode but in my below function i get portrait orientation... what is the problem here. Pls help me out -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if ( interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ) { NSLog(@" portrait orientation"); } else { NSLog(@"Landscape"); } }

    Read the article

  • XNA Track rotated pixel positions

    - by jonny adams
    Hi, Im making a game in xna where a tank has to move over a landscape. I need to be able find the bottom of the tank when it is rotated so I can make it move up and down as the player goes over the landscape. for example if i have a sprite at with its top left corner at 400,300 and i rotate it around its center by 45 degrees around its center, how do i find the new locations of the bottom track. Thanks

    Read the article

  • A question related to UITextfield

    - by user217572
    I have UITextfiled created dynamically by code I want to move keyboard up on click of UITextfield It should be set wether the return button of UITextfield press or not? and also it will be set whenever i move from portrait to landscape or landscape to portrait mode

    Read the article

  • IOS center bottom position view

    - by Ben_hawk
    I do the following to a loading animation, to place it at the bottom center of the screen. CGPoint bottomCenter = CGPointMake((self.imageView.bounds.size.width / 2), (self.imageView.bounds.size.height * 0.8)); self.activityView.center = bottomCenter; (imageView is the full screen splash image) If the orientation is portrait, it is positioned perfectly, however turning on its side, in landscape or upside down portrait and the animation ends up miles away :S Does anyone know the correct way to position this loading animation, its for the splash screen.

    Read the article

  • android layout-land and screen-rotation handling

    - by davs
    I have layouts for portrait mode (in folder layout) and for landscape one (in the folder layout-land). This screen is located under one of the tabs, so I had to handle screen rotating (after screen has been rotated, no default screen restart occurs). I would like to update view from 'layout-land' when screen rotates to landscape mode and from 'layout' when screen rotates to portrait one. How can I do this?

    Read the article

  • Android Camera exit rotate

    - by John
    I am first time to write a camera app. At program, I am using setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) and android:screenOrientation="landscape" in Manifest to set the landscape screen. My problem is when use System.exit() or Intent. The screen will change to portrait automatically. But in my program, it haven't set any screen orientation again. How can I prevent this problem? Thanks!!

    Read the article

  • iPhone OpenGL scrolling background jumps when texture is drawn for first time

    - by Magnum39
    I have been fighting a problem for a while now and would appreciate any help anybody could give. I have a sprite that moves within a landscape. The sprite remains in the center of the screen and the background moves to simulate that the sprite is moving within the landscape. I have split the landscape into sections so that I only draw the sections of the landscape that I need (are on screen). The Problem: As a new texture section of the screen appears on the screen (is drawn for the first time) the movement jumps. Almost like a frame is missed. I have done some timing experiments and I do not thinks a frame is missed. My processing is well below the 30fps that I have the animation set to. It only happens the first time the texture section is drawn. Is there something extra that is done the first time a texture is drawn? Here is the code: - (void) render{ // Sets up an array of values to use as the sprite vertices. const GLfloat sVerts[] = { -1.6f, -1.6f, 1.6f, -1.6f, -1.6f, 1.6f, 1.6f, 1.6f, }; static const GLfloat sTexCoords[] = { 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0 }; glDisableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); // Setup opengl to draw the object in correct orientation, size, position, etc glLoadIdentity(); // Enable use of the texture glEnable(GL_TEXTURE_2D); glVertexPointer(2, GL_FLOAT, 0, sVerts); glTexCoordPointer(2, GL_FLOAT, 0, sTexCoords); // draw the texture // set the position of the first tile float xOffset = -4.8; float yOffset = 4.8; int i; int y; int currentTexture = textureA; for(i=0; i<2; i++) { for(y=0; y<2; y++) { // test for the texture tile on the screen if not on screen then do not draw float localX = xOffset+(3.21*y); float localY = yOffset-(3.21*i); float xDiff = monkeyX - localX; float yDiff = monkeyY - localY; if(((xDiff < 3.2) && (xDiff > -3.2)) && ((yDiff <2.7) && (yDiff > -2.7))) { // bind the texture and set the vertex data pointers glBindTexture(GL_TEXTURE_2D, spriteTexture[currentTexture]); // move to draw position for the texture glLoadIdentity(); glTranslatef((localX+self.positionX), (localY+self.positionY), 0.0); //draw the texture glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } currentTexture++; } } }

    Read the article

  • Reset scale/width/zoom of Safari on iPhone using JavaScript/onorientationchange

    - by dwarbi
    I am displaying different content depending on how the user is holding his/her phone using the onorientationchange call in the body tag. This works great - I hide one div while making the other visible. The div in portrait mode looks great on first load. I use this to get the right scale/zoom: <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" /> Even if the content in portrait mode run over, the width is correct and the user can scroll down. The display in landscape mode is perfect too. However, if content in landscape mode requires the user the scroll down, then when the user returns to portrait mode, the screen is "zoomed out" so to speak. This happens whether or not the user scrolled down while in landscape mode. I've tried many different things to try to get the scale/zoom/width of the screen right, but no luck. Is there any way to do this? Thanks in advance!

    Read the article

  • How do I reset the scale/zoom of a web app on an orientation change on the iPhone?

    - by Elisabeth
    I'm having the same problem that a couple of others have had with getting the correct behavior in a web app on an orientation change, and there doesn't seem to be an obvious solution - I've seen this question asked a couple of times on Stack Overflow and no one's yet been able to answer it. When I start the app in portrait mode, it works fine. Then I rotate into landscape and it's scaled up. To get it to scale correctly for the landscape mode I have to double tap on something twice, first to zoom all the way in (the normal double tap behavior) and again to zoom all the way out (again, the normal double tap behavior). When it zooms out, it zooms out to the correct NEW scale for landscape mode. Switching back to portrait seems to work more consistently; that is, it handles the zoom so that the scale is correct when the orientation changes back to portrait. I am trying to figure out if this is a bug? or if this is something that can be fixed with Javascript? With the viewport meta content, I am setting the initial-scale to 1.0 and I am NOT setting minimum or maximum scale (nor do I want to). I am setting the width to device-width. Any ideas? I know a lot of people would be grateful to have a solution as it seems to be a persistent problem. Thank you!

    Read the article

  • Subview Doesnt AutoSize When Added to Root View Controller

    - by Per
    Hello, I have a root view controller that will have up to 10 or so subviews. I am implementing autorotation/autosize accross the entire app. My problem is this: - When I allocate all the view controllers and add each as a subview to the root controller during startup, everything works as it should. The only problem is that each view controller needs time to initialize. This causes my application to load very slowly. Instead I am trying to allocate the view controllers as they are required. Now I find that if the application goes into Landscape, and I allocate a view controller that is designed in portrait, it will autorotate but the autosize doesnt happen. In other words as soon as the subview is added to the root controller in portrait mode it rotates and sizes correctly (and stays that way). If the subview is added when the root controller is in landscape it rotates but doesnt autosize (and view sizes remain messed up rotating back to portrait) I have tried to force an autosize by calling SetNeedsLayout, SetNeedsDisplay, and LayoutIfNeeded but nothing works. I know i could probably do this manually by determining the root controllers orientation and resizing the subviews appropriately, but this is a lot of work for something that should work automatically. Am I missing something? Any help would be appreciated. My project is an iPad port from an iPhone app, the iPhone app doesnt rotate so Im not sure if this may be something wrong with the 3.2 beta.

    Read the article

  • Modal view becomes partly transparent when dismissing?

    - by Jaanus
    A completely ordinary setup: UIViewController where I push another UIVC: BlahVc *blah = [[BlahVc alloc] initWithNibName:@"Blah" bundle:nil]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:blah]; blah.delegate = self; [self presentModalViewController:nav animated:YES]; [nav release]; [blah release]; Details about Blah: to support both landscape and portrait with least effort, I built Blah.xib so that inside Blah's main view, call it view A, there is another view B, with width fixed to 320px, that positions itself in the centre of the screen. With portrait iPhone it fills up the whole screen, with landscape there are margins on the side. So far, so good. Autorotate etc works well. Now, to dismiss blah, I use the recommended setup: inside Blah, I do: [self.delegate blahDidCancel:self]; And in the parent VC, I have: - (void)blahDidCancel:(Blah *)blah { [self dismissModalViewControllerAnimated:YES]; } Both view A's and B's backgrounds are opaque white. Problem: as soon as it hits the dismissModalViewControllerAnimated line, view A seems to become transparent, while view B remains white. This is not a problem in portrait since view B still fills up the screen. But in landscape, the result is that view B is still opaque, but has see-through transparent margins on the side (where view A used to be that has now mysteriously become transparent), from where the parent view contents comes through during the dismissing animation. Why does it seem like view A becomes transparent upon dismissing the modal VC?

    Read the article

  • Fixing parent controller's elements after screen orientation

    - by Jonas Anderson
    I have a tab bar application with mixed orientation support for only some views. One of the child view controller shown from one of the tab's navigation controller is displayed only in Landscape mode. In order to accomplish this, I've done the view transformation for the child view as suggested here: Is there a documented way to set the iPhone orientation? The only problem I'm seeing is that after I've performed the orientation adjustment for the child controller and then readjusted orientation back to normal on its dismissal, the contents of the (parent) navigation controller is still shown with Landscape mode dimensions despite the navigation controller reporting the correct value for the interfaceOrientation. How do I ensure that view's size is reset to match the orientation without hardcoding screen dimensions? I have the following in the root navigation controller's viewWillAppear (invoked after the child controller is dismissed): - (void)viewWillAppear:(BOOL)animated { NSLog(@"viewFrame: (%2f, %2f), width: %2f, height: %2f\n", self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height); // Frame values are (0, 0) for (x,y) width: 320, height: 367 before I // displayed child controller. // Frame values are (0,0) width: 480, height: 219 after returning from child // controller -- still has the landscape dimensions NSLog(@"orientation: %d", self.interfaceOrientation); // reports portrait as expected } I've tried to invoke 'layoutIfNeeded' as well as 'setNeedsDisplay' on the view but neither of them bring the view contents into the correct display. Any suggestions would be greatly appreciated.

    Read the article

  • Is there a difference between starting an application from the OS or from adb

    - by aruwen
    I do have a curious error in my application. My app crashes (don't mind the crash, I roughly know why - classloader) when I start the application from the OS directly, then kill it from the background via any Task Killer (this is one of the few ways to reproduce the crash consistently - simulating the OS freeing memory and closing the application) and try to restart it again. The thing is, if I start the application via adb shell using the following command: adb shell am start -a android.intent.action.MAIN -n com.my.packagename/myLaunchActivity I cannot reproduce the crash. So is there any difference in how Android OS calls the application as opposed to the above call? EDIT: added the manifest (just changed names) <?xml version="1.0" ?> <manifest android:versionCode="5" android:versionName="1.05" package="com.my.sample" xmlns:android="http://schemas.android.com/apk/res/android"> <uses-sdk android:minSdkVersion="7"/> <application android:icon="@drawable/square_my_logo" android:label="@string/app_name"> <activity android:label="@string/app_name" android:name="com.my.InfoActivity" android:screenOrientation="landscape"></activity> <activity android:label="@string/app_name" android:name="com.my2.KickStart" android:screenOrientation="landscape"/> <activity android:label="@string/app_name" android:name="com.my2.Launcher" android:screenOrientation="landscape"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/></manifest> starting the com.my2.Launcher from the adb shell

    Read the article

  • Manually changing keyboard orientation for a view that's on top of a camera view

    - by XKR
    I'm basically trying to reproduce the core functionality of the "At Once" app. I have a camera view and another view with a text view on it. I add both views to the window. All is well so far. [window addSubview:imagePicker.view]; [window addSubview:textViewController.view]; I understand that the UIImagePickerController does not support autorotation, so I handle it manually by watching UIDeviceOrientationDidChangeNotifications and applying the necessary transforms to the textViewController.view. Now, the problem here is the keyboard. If I do nothing, it just stays in portrait mode. I can get it to rotate by adding the following code to the notification handler. [[UIApplication sharedApplication] setStatusBarOrientation:interfaceOrientation]; [textView resignFirstResponder]; [textView becomeFirstResponder]; However, the following simple test produces weird behavior. Start the app in portrait mode. Rotate the device 90 degrees clockwise. Rotate the device 90 degrees counterclockwise (back to the initial position). Rotate the device 90 degrees clockwise. After step 4, instead of the landscape-mode keyboard, the portrait-style keyboard is shown, skewed to fit in the landscape keyboard frame. Perhaps my approach is wrong from the start. I was wondering if anyone has been able to reliably make the keyboard change its orientation in response to setStatusBarOrientation.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >