Skip to content

Commit 76edec1

Browse files
committed
给 新建项目、项目设置 添加屏幕转向限制
1 parent b6ae464 commit 76edec1

4 files changed

Lines changed: 52 additions & 0 deletions

File tree

Coding_iOS/Controllers/NewProject/NewProjectTypeViewController.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,17 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *
163163
// [self.navigationController popViewControllerAnimated:YES];
164164
}
165165

166+
#pragma mark - Orientations
167+
- (BOOL)shouldAutorotate{
168+
return UIInterfaceOrientationIsLandscape(self.interfaceOrientation);
169+
}
170+
171+
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
172+
return UIInterfaceOrientationPortrait;
173+
}
174+
175+
- (NSUInteger)supportedInterfaceOrientations {
176+
return UIInterfaceOrientationMaskPortrait;
177+
}
178+
166179
@end

Coding_iOS/Controllers/NewProject/NewProjectViewController.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,17 @@ -(void)newProjectType:(NewProjectTypeViewController *)newProjectVC didSelectType
219219
}
220220
}
221221

222+
#pragma mark - Orientations
223+
- (BOOL)shouldAutorotate{
224+
return UIInterfaceOrientationIsLandscape(self.interfaceOrientation);
225+
}
226+
227+
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
228+
return UIInterfaceOrientationPortrait;
229+
}
230+
231+
- (NSUInteger)supportedInterfaceOrientations {
232+
return UIInterfaceOrientationMaskPortrait;
233+
}
234+
222235
@end

Coding_iOS/Controllers/ProjectSetting/ProjectAdvancedSettingViewController.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,17 @@ -(BOOL)textFieldShouldReturn:(UITextField *)textField{
125125
return YES;
126126
}
127127

128+
#pragma mark - Orientations
129+
- (BOOL)shouldAutorotate{
130+
return UIInterfaceOrientationIsLandscape(self.interfaceOrientation);
131+
}
132+
133+
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
134+
return UIInterfaceOrientationPortrait;
135+
}
136+
137+
- (NSUInteger)supportedInterfaceOrientations {
138+
return UIInterfaceOrientationMaskPortrait;
139+
}
140+
128141
@end

Coding_iOS/Controllers/ProjectSetting/ProjectSettingViewController.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,17 @@ -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
184184
[vc setValue:self.project forKey:@"project"];
185185
}
186186

187+
#pragma mark - Orientations
188+
- (BOOL)shouldAutorotate{
189+
return UIInterfaceOrientationIsLandscape(self.interfaceOrientation);
190+
}
191+
192+
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
193+
return UIInterfaceOrientationPortrait;
194+
}
195+
196+
- (NSUInteger)supportedInterfaceOrientations {
197+
return UIInterfaceOrientationMaskPortrait;
198+
}
199+
187200
@end

0 commit comments

Comments
 (0)