Просмотр исходного кода

20170221

Fix homepage orientation
Ray Zhang 9 лет назад
Родитель
Сommit
8c341a68b5
1 измененных файлов с 5 добавлено и 4 удалено
  1. 5 4
      RedAnt ERP Mobile/common/AutoScrollImage/CycleScrollView.m

+ 5 - 4
RedAnt ERP Mobile/common/AutoScrollImage/CycleScrollView.m

@@ -40,7 +40,7 @@
 }
 -(void) animationDuration:(NSTimeInterval)animationDuration
 {
-   // return;
+    return;
     
     if (animationDuration > 0.0) {
 //        self.animationTimer = [NSTimer scheduledTimerWithTimeInterval:(self.animationDuration = animationDuration)
@@ -83,7 +83,7 @@
        // Initialization code
     self.autoresizesSubviews = YES;
 //    self.scrollView = [[UIScrollView alloc] initWithFrame:self.bounds];
-    self.scrollView.autoresizingMask = 0xFF;
+    self.scrollView.autoresizingMask =      UIViewAutoresizingFlexibleHeight  |UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin;//0xFF;
     self.scrollView.contentMode = UIViewContentModeCenter;
     self.scrollView.contentSize = CGSizeMake(3 * CGRectGetWidth(self.scrollView.frame), CGRectGetHeight(self.scrollView.frame));
 //    CGSize sss= self.scrollView.contentSize;
@@ -139,7 +139,7 @@
         // Initialization code
         self.autoresizesSubviews = YES;
         self.scrollView = [[UIScrollView alloc] initWithFrame:self.bounds];
-        self.scrollView.autoresizingMask = 0xFF;
+        self.scrollView.autoresizingMask =     UIViewAutoresizingFlexibleHeight  |UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin;//0xFF;
         self.scrollView.contentMode = UIViewContentModeCenter;
         self.scrollView.contentSize = CGSizeMake(3 * CGRectGetWidth(self.scrollView.frame), CGRectGetHeight(self.scrollView.frame));
         self.scrollView.delegate = self;
@@ -153,6 +153,7 @@
         pageFrame.origin.y = self.frame.size.height -16-20;
         pageFrame.size.height = 20;
         self.pageControl = [[UIPageControl alloc] initWithFrame:pageFrame];
+        self.pageControl.autoresizingMask =     UIViewAutoresizingFlexibleHeight  |UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin;
         [self addSubview:self.pageControl];
         
         
@@ -173,7 +174,7 @@
     for (UIView *contentView in self.contentViews) {
         contentView.userInteractionEnabled = YES;
         
-        CGRect rightRect = contentView.frame;
+        CGRect rightRect = self.frame;//contentView.frame;
         rightRect.origin = CGPointMake(CGRectGetWidth(self.scrollView.frame) * (counter ++), 0);
         
         contentView.frame = rightRect;