//iOS 在开启个人热点后会调用此方法
- (void)viewWillLayoutSubviews
//
// ViewController.m
// test_Person_Hotspot_01
//
// Created by admin on 1/28/16.
// Copyright © 2016 jeffasd. All rights reserved.
//
#import "ViewController.h"
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width/2
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
@interface ViewController ()
{
UIButton *button;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
button = [UIButton buttonWithType:UIButtonTypeCustom];
// [[UIScreen mainScreen] bounds].size.width/2;
// button.frame = CGRectMake(SCREEN_WIDTH, SCREEN_HEIGHT - 20 -50, 50, 50);
button.frame = CGRectMake(SCREEN_WIDTH, self.view.frame.size.height - 20 -50, 50, 50);
// button.bounds = CGRectMake(SCREEN_WIDTH, SCREEN_HEIGHT - 20 -50, 50, 50);
// button.bounds = CGRectMake(50, 50, 50, 42);
button.backgroundColor = [UIColor cyanColor];
[self.view addSubview:button];
self.tabBar.frame = CGRectMake(0, self.view.frame.size.height-40, 320, 40);
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
self.view.backgroundColor = [UIColor whiteColor];
}
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
self.view.backgroundColor = [UIColor whiteColor];
}
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
self.view.backgroundColor = [UIColor whiteColor];
}
//iOS 在开启个人热点后会调用此方法
- (void)viewWillLayoutSubviews{
button.frame = CGRectMake(SCREEN_WIDTH, self.view.frame.size.height - 20 -50, 50, 50);
[super viewWillLayoutSubviews];
self.view.backgroundColor = [UIColor redColor];
[self.view layoutSubviews];
NSLog(@"the Screen is %@", NSStringFromCGRect([[UIScreen mainScreen] bounds]));
NSLog(@"the VC view frame is %@", NSStringFromCGRect(self.view.frame));
// button.frame = CGRectMake(SCREEN_WIDTH, SCREEN_HEIGHT - 20 -50, 50, 50);
// button.frame = CGRectMake(SCREEN_WIDTH, self.view.frame.size.height - 20 -50, 50, 50);
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
1.gdb常用调试命令 要用gdb调试的话,编译命令需要添加-g参数,例如 1. gcc -g main.c -o main b linenum 在第 linenum行打断点 l 显示源代码…