myell0w / MTStatusBarOverlay

A custom iOS status bar overlay seen in Apps like Reeder, Evernote and Google Mobile App
MIT License
1.92k stars 325 forks source link

MTDetailViewModeHistory not work for me #45

Closed mobilehub closed 12 years ago

mobilehub commented 12 years ago

Hi myell0w,

I use the below code to test, and want to see the history of the post message, but failed, when I click the status bar, nothing happen. if I change the detailViewMode to MTDetailViewModeDetailText, will animation a black view download from the status bar.

MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance]; overlay.animation = MTStatusBarOverlayAnimationFallDown; // MTStatusBarOverlayAnimationShrink overlay.detailViewMode = MTDetailViewModeHistory; // enable automatic history-tracking and show in detail-view overlay.delegate = self; overlay.historyEnabled = YES; [overlay postMessage:@"Following @myell0w on Twitter…"]; [overlay postMessage:@"Following @myell0w on Twitter1…"]; [overlay postMessage:@"Following @myell0w on Twitter2…"];

I have no idear, So get help here.

Best Regards

Thanks Very much.

mobilehub commented 12 years ago

I know the reason now, the problem is in the

y = -(kMaxHistoryTableRowCount - MIN(self.messageHistory.count, kMaxHistoryTableRowCount)) * kHistoryTableRowHeight;

the MIN(self.messageHistory.count, kMaxHistoryTableRowCount) are not correct
should change to uint count = self.messageHistory.count; MIN(count, kMaxHistoryTableRowCount)

I think the macro problem. Best Regards