Embed ImageView in ScrollView with Auto Layout on iOS 6

前端 未结 2 1869
感情败类
感情败类 2020-12-13 07:28

I am trying to make very simple element with new iOS 6 SDK with auto layout. I have an ImageView and Embed it in ScrollView. (everything build with Interface Builder). The .

2条回答
  •  难免孤独
    2020-12-13 07:57

    I just encountered the same issue in a tutorial that I was updating. I attempted programmatically deleting constraints, cursing, and banging my head against the wall - no luck.

    About 5 minutes ago, however, I tried something that had fixed another issue I encountered, and, ta da! UIScrollView is working again! The solution was to move the old code that sets the UIScrollView contentSize property into an implementation of viewDidAppear, rather than viewDidLoad:

    - (void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
        self.theScroller.contentSize=CGSizeMake(200.0,2000.0);
    }
    

    I hope this helps someone else encountering some of the headaches that have appeared with Auto Layout.

提交回复
热议问题