Save UIImage, Load it in Wrong Orientation
The root cause is PNG format doesn’t have image orientation information, but JPEG format does. So the easiest way to solve this problem is saving your file in JPEG format using UIImageJPEGRepresentation()
The root cause is PNG format doesn’t have image orientation information, but JPEG format does. So the easiest way to solve this problem is saving your file in JPEG format using UIImageJPEGRepresentation()
android:targetSdkVersion=”16″ Remove this statement in your manifest file, because SDKVersion=16 is only available for v4.0.
Ok guys, it seems like this bug for android won’t be fixed for a while. Although I found a way to implement the ExifInformation so that both devices (ones with proper Exif tag, and also improper exif tags work together).. So the issue is on some (newer) devices, there’s a bug that makes the picture … Read more
This was my gremlin for the ~same problem: Caution: Beginning with Android 3.2 (API level 13), the “screen size” also changes when the device switches between portrait and landscape orientation. Thus, if you want to prevent runtime restarts due to orientation change when developing for API level 13 or higher (as declared by the minSdkVersion … Read more
You can read about some of the possible causes here: Technical Q&A QA1688 – Why won’t my UIViewController rotate with the device? In your situation its probably the fact that you are adding the view as another subview to the window. Only the first subview gets the rotation events. What you can do is add … Read more
UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init]; [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical]; Note too that it seems to be fine to call this in prepareForLayout in your flow layout… @interface LayoutHorizontalThings : UICollectionViewFlowLayout @end @implementation LayoutHorizontalBooks -(void)prepareLayout { [super prepareLayout]; self.scrollDirection = UICollectionViewScrollDirectionHorizontal; self.minimumInteritemSpacing = 0; self.minimumLineSpacing = 0; self.itemSize = CGSizeMake(110,130); self.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0); }
Checking at runtime (your first way) is completely different from #if at compile time. The preprocessor directives won’t give you a universal app. The preferred way is to use Apple’s Macro: if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // The device is an iPad running iPhone 3.2 or later. } else { // The device is an … Read more
You also want to add the maximum scale <meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1″> UPDATED I agree with some of the comments, the declaration should not limit the scaling by the user as this is bad practice. The below is a better approach and I believe that the zooming bug has long since been fixed by … Read more
What about this one : <DockPanel Margin=”8″> <Border CornerRadius=”6″ BorderBrush=”Gray” Background=”LightGray” BorderThickness=”2″ DockPanel.Dock=”Top”> <StackPanel Orientation=”Horizontal”> <TextBlock FontSize=”14″ Padding=”0 0 8 0″ HorizontalAlignment=”Center” VerticalAlignment=”Center”>Search:</TextBlock> <TextBox x:Name=”txtSearchTerm” HorizontalAlignment=”Center” VerticalAlignment=”Center” /> <Image Source=”lock.png” Width=”32″ Height=”32″ HorizontalAlignment=”Center” VerticalAlignment=”Center” /> </StackPanel> </Border> <StackPanel Orientation=”Horizontal” DockPanel.Dock=”Bottom” Height=”25″ /> </DockPanel>
Add a notifier in the viewWillAppear function -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil]; } The orientation change notifies this function – (void)orientationChanged:(NSNotification *)notification{ [self adjustViewsForOrientation:[[UIApplication sharedApplication] statusBarOrientation]]; } which in-turn calls this function where the moviePlayerController frame is orientation is handled – (void) adjustViewsForOrientation:(UIInterfaceOrientation) orientation { switch (orientation) { case UIInterfaceOrientationPortrait: case … Read more