我尝试过自定义AccountKit的标题视图,但它没有显示标题视图。 这就是我尝试的方式:
import Foundation
import AccountKit
class AccountKitUIManager: AKFSkinManager {
@objc override func headerViewForState(state: AKFLoginFlowState) -> UIView? {
let view = UIView.init(frame: CGRect.init(x: 0, y: 0, width: 100, height: 50))
view.backgroundColor = UIColor.blue()
return view
}
}
和
func signInWithPhoneNumber() {
let inputState = NSUUID().UUIDString
let vc: AKFViewController = accountKit!.viewControllerForPhoneLoginWithPhoneNumber(nil, state: inputState) as! AKFViewController
vc.delegate = self
vc.uiManager = AccountKitUIManager.init(skinType: AKFSkinType.Classic, primaryColor: UIColor.blue(), backgroundImage: UIImage(named: "Login-bg-new"), backgroundTint: AKFBackgroundTint.White, tintIntensity: 0.1)
vc.whitelistedCountryCodes = ["VN"]
self.presentViewController(vc as! UIViewController, animated: true, completion: nil)
}
有什么不对?请帮我。感谢
参考链接: https://developers.facebook.com/docs/accountkit/ios/customizing
答案 0 :(得分:1)
为此,您必须使用UILabel,如果您只想显示空间视图(无内容的视图),请使用带填充的UILabel。