devinross / tapkulibrary

tap + haiku = tapku, a well crafted open source iOS framework
http://devinross.com/tapku/documentation
MIT License
3.9k stars 653 forks source link

TKCalendarMonthView is not working correctly when adding as subview in viewDidLoad #223

Closed ExtremeMan closed 11 years ago

ExtremeMan commented 11 years ago

Hi,

I have updated to lasted source code and found that TKCalendarMonthView is not working correctly anymore. Reverting commits one by one I have found that commit 2b17f5dfccc61e285efd229824f556e1a591f743 caused that issue.

What I have:

- (void)viewDidLoad
{
      [super viewDidLoad];

      _calendarView = [[TKCalendarMonthView alloc] initWithSundayAsFirst:NO];
      _calendarView.delegate = self;
      _calendarView.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin;
      if (_defaultDate) [_calendarView selectDate:_defaultDate];
      UpdateFrameX(_calendarView, 0); // changing frame.origin.x
      UpdateFrameY(_calendarView, 44); // changing frame.origin.y
      [self.view addSubview:_calendarView];
}

What I see: TKCalendarMonthView is in the top of my screen. I can change origin.y in viewDidAppear and it will jump to correct position but when I am changing month - again - it is on the top of the view. And the weirdest thing is that when I am closing view (selecting date) and opening it again - I see black screen.

I saw you changed a lot of code so I didn't find bug by myself. Hope, you can fix that quickly. But for now - I have to use commit 7aa6d0adacaf508d528da135cd6b7b812d1fc232

devinross commented 11 years ago

Can you post a sample xcode project that replicated the issue?

ExtremeMan commented 11 years ago

@devinross here you can find an example where issue with wrong screen position is reproduced: https://dl.dropbox.com/u/6872784/tmp/TapkuDemo.zip I was not able to reproduce black screen in demo projects.