• The following problems are encountered in the project. There must be many ways to solve the problems. What I have listed may not be the best solution. If you have any questions, you are welcome to correct, supplement and exchange.

  1. Solve the problem of pressing two buttons at the same time into two views. [button setExclusiveTouch:YES];

  2. The output width is 414 on the 6p simulator and 375 on the 6P real machine. This is a problem with the Settings of the test machine. Go to Settings – Display & Brightness and change the display mode to “Standard”.

  3. Image stretching

UIImage* img=[UIImage imageNamed:@"2.png"]; UIEdgeInsets edge=UIEdgeInsetsMake(0, 10, 0,10); / / UIImageResizingModeStretch: stretching mode, through the tensile UIEdgeInsets specified rectangular area to fill the picture / / UIImageResizingModeTile: Tile pattern, through repetition shows UIEdgeInsets specified rectangular area to populate the figure img = [img resizableImageWithCapInsets: edge resizingMode: UIImageResizingModeStretch]; self.imageView.image=img;Copy the code
  1. UITableView free at the top of the organizations, on top of the cell is not in question 7 new attribute automaticallyAdjustsScrollViewInsets viewcontroller iOS, Set the scrollView inset to “no” and set the scrollView inset to “no”
self.automaticallyAdjustsScrollViewInsets=NO;
Copy the code
  1. Change the color of the tableViewCell selected state
cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.frame];
cell.selectedBackgroundView.backgroundColor = [UIColor whiteColor];
Copy the code
  1. The first cell is selected by default
    NSInteger selectedIndex = 0;

    NSIndexPath *selectedIndexPath = [NSIndexPath indexPathForRow:selectedIndex inSection:0];

    [_leftSiftTable selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
Copy the code
  1. Sets the left alignment of words on BTN
timeBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; TimeBtn. ContentEdgeInsets = UIEdgeInsetsMake (0, 10, 0, 0).Copy the code
  1. Modify textFieldplaceholder font color and size
textField.placeholder = @"username is in here!";  
[textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];  
[textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];  
Copy the code
  1. Change UILable font size to make content adaptivelab.adjustsFontSizeToFitWidth=YES;Method 2:
label.numberOfLines = 0;
label.lineBreakMode = NSLineBreakByWordWrapping;
Copy the code
  1. To change the font color of the status bar, only two colors can be set: black and white. By default, black is set to white. (1) Add Status bar style to plist, Value of UIStatusBarStyleLightContent (white) or UIStatusBarStyleDefault (black color) (2) in the Info. Set in the plist UIViewControllerBasedStatusBarAppearance to NO and then write the following code inside the controller needs to be changed
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
Copy the code
  1. To enable the system’s own right – swipe return after the previous customization leftBarButtonItem, you can set the following code
self.navigationController.interactivePopGestureRecognizer.delegate = self;
Copy the code
  1. Remove the black line below the navigation bar
[self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
Copy the code
  1. Deselect the cell when clicking on it
-(void)tableView:(UITableView *)tableViewdidSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
Copy the code
  1. Modify the Pagecontrol color
_pageControl.currentPageIndicatorTintColor=SFQRedColor;
_pageControl.pageIndicatorTintColor=SFQGrayColor;
Copy the code
  1. The userInteractionEnabled property of UIView and UIImageview is YES by default and the default userInteractionEnabled of UIView is NO by default UserInteractionEnabled =YES Indicates that the view can interact with each other, and does not respond to the parent view. UserInteractionEnabled =NO If the interaction is not possible, the sub-views on the view will not respond.

  2. Remove the stickiness of the UITableView section so that it doesn’t hover.

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {if (scrollView == _tableView) {  
        CGFloat sectionHeaderHeight = 36;
        
        if (scrollView.contentOffset.y <= sectionHeaderHeight && scrollView.contentOffset.y >= 0) {  
            scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);  
        } else if(scrollView.contentOffset.y >= sectionHeaderHeight) { scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0); }}}Copy the code
  1. Xib launchscreen. xib will not change the launchscreen. xib image.Solution: Delete app-> restart phone -> reinstall. The reason is that the system saves the image of launchscreen.xib when the app is first launched, and it will be used again when the app is launched again, as long as it exists. Instead of using launchscreen.xib, use Xcode7's latest launchscreen.storyboard, or stick with the old LaunchImage.You can seeFlying_Einstein’s LaunchImage and launchscreen.xib mix the pits