开发者

UIButton in UIView in UIScrollView not loading properly

开发者 https://www.devze.com 2023-01-19 15:23 出处:网络
Kinda confusing title but oh well. I have a UIScrollView in my vi开发者_开发知识库ewController, in that is 3 UIViews with some buttons in each. I download data from a server and populate it into the

Kinda confusing title but oh well.

I have a UIScrollView in my vi开发者_开发知识库ewController, in that is 3 UIViews with some buttons in each. I download data from a server and populate it into the view and this works as soon as you start scrolling the UIScrollView, but sometimes the buttons only partially load.

Usually its the button label without my formatting added to it. The button works and as soon as you click the button the rest of view loads correctly. Basically if the UIScrollView is touched in anyway it displays correctly.

I've tried adding and removing the scrollView to the view and I've called [scrollView setNeedsDisplay] and the exact same thing happens.

Anyone come across this?

EDIT: screen shot before and after (just basic to demonstrate whats happening)

UIButton in UIView in UIScrollView not loading properly

UIButton in UIView in UIScrollView not loading properly


I was building the buttons in drawRect which was causing issues. Built the buttons in a separate method and it worked fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消