Ios 选项卡';s页面不显示
选项卡的页面不显示。 我写的光控器就像Ios 选项卡';s页面不显示,ios,swift,xcode,Ios,Swift,Xcode,选项卡的页面不显示。 我写的光控器就像 import Foundation import UIKit class PhotoController:UIViewController,UINavigationControllerDelegate,UIImagePickerControllerDelegate{ @IBOutlet weak var myImageView: UIImageView! @IBAction func PhotoSelect(_ sender: Any)
import Foundation
import UIKit
class PhotoController:UIViewController,UINavigationControllerDelegate,UIImagePickerControllerDelegate{
@IBOutlet weak var myImageView: UIImageView!
@IBAction func PhotoSelect(_ sender: Any) {
}
@IBAction func PhotoSend(_ sender: Any) {
let myPickerController = UIImagePickerController()
myPickerController.delegate = self;
myPickerController.sourceType = UIImagePickerControllerSourceType.photoLibrary
self.present(myPickerController, animated: true, completion: nil)
}
private func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject])
{
myImageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage
self.dismiss(animated: true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
//myImageUploadRequest()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
在这个控制器中,我的目标是选择照片并将其发送到服务器。
我使用的是TabbarController,但当我运行emulator时,并没有显示与PhotoController连接的主情节提要。我不知道为什么会发生这种情况,我认为至少有2个按钮显示在那里。但2个按钮并没有显示。
但是,当我运行emulator时,会显示ViewController。
ViewController是
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var webBrowser: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
let url = NSURL(string:"https://www.google.com")
let request = NSURLRequest(url:url! as URL)
self.webBrowser.loadRequest(request as URLRequest)
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
在这个控制器中,谷歌网站被显示出来,一切正常。
所以,我认为某些联系是错误的,但我找不到重点。
我的主板是
与光控器和主控板的连接为
如何解决此问题?是否将TabBarController设置为初始视图控制器?@SunilPrajapati是