建一个类如,在Contans.swift中import UIKitlet kMAIN_SIZE = UIScreen.mainScreen().bounds在其他地方直接用比如在MyTabbarViewController.swift中var bgView = UIView(frame:CGRectMake(0, 0, kMAIN_SIZE.width, kMAIN_SIZE.height - 20 - 44));