-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calendar height increases when I change from week view to month view. #263
Comments
Have you log out the height? |
What do you mean by "log out" the height? I gave the calendar a height constrain. And created the IBOutlet for it. I was debugging it and I discover that the "row" height increases every time I go from week view to month view. Is there a way to make the row's height stay the same height? I set the adjustsFontSizeToFitContentSize to NO so that the size of the letter dont increase. But the letters size increase because the row increases. If I can make the rows to stay the same height it would fix everything. Any comments or feedbacks on this? Here are the screenshots: Jorge Gomez
|
You said 'the height increases a bit', I mean have you use NSLog to print the height |
I discover that the problem is not with the height of the calendar view but with the height of the rows. I tried to print the height of the rows but I cant. I don't see where the rows height is being stored. any comments or feedbacks? Thanks |
Never mind. Can you make an example that reproduces this issus and create a dropbox link or wetransfer link? |
Everytime I change from week view to month view the height increases a bit.
How can I fix this?
import "CalendarMainViewController.h"
import "FSCalendar.h"
import "AppDelegate.h"
@interface CalendarMainViewController ()
@Property (nonatomic, strong) AppDelegate *appDelegate;
@EnD
@implementation CalendarMainViewController
(void)viewDidLoad {
[super viewDidLoad];
self.appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
//Makes the calendar scroll vertically
//_calendarView.scrollDirection = FSCalendarScrollDirectionVertical;
//_calendar.appearance.adjustsFontSizeToFitContentSize = NO;
//_calendar.showsPlaceholders = YES;
[_calendar selectDate:[NSDate date]];
_calendar.delegate = self;
_calendar.dataSource = self;
}
[super didReceiveMemoryWarning];
}
-(void) viewWillAppear:(BOOL)animated{
self.tabBarController.title = @"Calendar";
}
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 0;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
cell.textLabel.text = @"Event";
return cell;
}
//makes sure the height constrains is the adecuate when changing from week view to month view(and vice versa).
(void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated
{
_calendarViewHeight.constant = CGRectGetHeight(bounds);
[self.view layoutIfNeeded];
}
(void)calendarCurrentScopeWillChange:(FSCalendar *)calendar animated:(BOOL)animated
{
_calendarViewHeight.constant = [calendar sizeThatFits:CGSizeZero].height;
[self.view layoutIfNeeded];
}
//creates an event for the date selected.
(IBAction)addEventButton:(id)sender {
}
if(_segmentedControl.selectedSegmentIndex == 0){
_calendar.scope = FSCalendarScopeWeek;
}
else{
_calendar.scope = FSCalendarScopeMonth;
}
}
@EnD
The text was updated successfully, but these errors were encountered: