Commit 00008117 authored by Wilson's avatar Wilson

Fix subview frame issue

parent 9456dbbc
...@@ -516,11 +516,20 @@ ...@@ -516,11 +516,20 @@
albumModel.selectedModels = imagePickerVc.selectedModels; albumModel.selectedModels = imagePickerVc.selectedModels;
} }
if (!_tableView) { if (!_tableView) {
CGFloat top = 0; CGFloat top = 0;
if (self.navigationController.navigationBar.translucent) { CGFloat tableViewHeight = 0;
if (self.navigationController.navigationBar.isTranslucent) {
top = 44; top = 44;
if (iOS7Later) top += 20; if (iOS7Later) top += 20;
tableViewHeight = self.view.tz_height - top;
}
else {
CGFloat navigationHeight = 44;
if (iOS7Later) navigationHeight += 20;
tableViewHeight = self.view.tz_height - navigationHeight;
} }
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, top, self.view.tz_width, self.view.tz_height - top) style:UITableViewStylePlain]; _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, top, self.view.tz_width, self.view.tz_height - top) style:UITableViewStylePlain];
_tableView.rowHeight = 70; _tableView.rowHeight = 70;
_tableView.tableFooterView = [[UIView alloc] init]; _tableView.tableFooterView = [[UIView alloc] init];
......
...@@ -121,11 +121,18 @@ static CGSize AssetGridThumbnailSize; ...@@ -121,11 +121,18 @@ static CGSize AssetGridThumbnailSize;
layout.minimumLineSpacing = margin; layout.minimumLineSpacing = margin;
CGFloat top = 0; CGFloat top = 0;
if (self.navigationController.navigationBar.translucent) { CGFloat collectionViewHeight = 0;
if (self.navigationController.navigationBar.isTranslucent) {
top = 44; top = 44;
if (iOS7Later) top += 20; if (iOS7Later) top += 20;
collectionViewHeight = tzImagePickerVc.showSelectBtn ? self.view.tz_height - 50 - top : self.view.tz_height - top;;
} }
CGFloat collectionViewHeight = tzImagePickerVc.showSelectBtn ? self.view.tz_height - 50 - top : self.view.tz_height - top; else {
CGFloat navigationHeight = 44;
if (iOS7Later) navigationHeight += 20;
collectionViewHeight = tzImagePickerVc.showSelectBtn ? self.view.tz_height - 50 - navigationHeight : self.view.tz_height - navigationHeight;
}
_collectionView = [[TZCollectionView alloc] initWithFrame:CGRectMake(0, top, self.view.tz_width, collectionViewHeight) collectionViewLayout:layout]; _collectionView = [[TZCollectionView alloc] initWithFrame:CGRectMake(0, top, self.view.tz_width, collectionViewHeight) collectionViewLayout:layout];
_collectionView.backgroundColor = [UIColor whiteColor]; _collectionView.backgroundColor = [UIColor whiteColor];
_collectionView.dataSource = self; _collectionView.dataSource = self;
...@@ -166,7 +173,17 @@ static CGSize AssetGridThumbnailSize; ...@@ -166,7 +173,17 @@ static CGSize AssetGridThumbnailSize;
TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
if (!tzImagePickerVc.showSelectBtn) return; if (!tzImagePickerVc.showSelectBtn) return;
UIView *bottomToolBar = [[UIView alloc] initWithFrame:CGRectMake(0, self.view.tz_height - 50, self.view.tz_width, 50)]; CGFloat yOffset = 0;
if (self.navigationController.navigationBar.isTranslucent) {
yOffset = self.view.tz_height - 50;
}
else {
CGFloat navigationHeight = 44;
if (iOS7Later) navigationHeight += 20;
yOffset = self.view.tz_height - 50 - navigationHeight;
}
UIView *bottomToolBar = [[UIView alloc] initWithFrame:CGRectMake(0, yOffset, self.view.tz_width, 50)];
CGFloat rgb = 253 / 255.0; CGFloat rgb = 253 / 255.0;
bottomToolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:1.0]; bottomToolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:1.0];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment