내 탐색 모음 항목에 대한 사용자 정의보기로 일반 이미지보기를하고 있어요하지만 그것이 무슨 일이 일어나고 있는지입니다 : 이것은탐색 모음 사용자 정의 이미지보기 문제 11
let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 34, height: 34))
imageView.kf.setImage(with: user.profilePictureURL)
if user.profilePictureURL == nil {
imageView.image = #imageLiteral(resourceName: "ProfilePlaceholderSuit")
}
imageView.backgroundColor = .white
imageView.layer.masksToBounds = true
imageView.layer.cornerRadius = 17
imageView.layer.borderWidth = 1
imageView.layer.borderColor = UIColor.white.cgColor
imageView.isUserInteractionEnabled = true
imageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(handleTap)))
navigationItem.rightBarButtonItem = UIBarButtonItem(customView: imageView)
print("ok, so the image view frame is", imageView.frame) // 0, 0, 34, 34
아래 없음처럼 코드에 이미지 뷰의 제약 조건을 추가 할 수 없습니다 현명한
다른, 당신이 대신 프레임 – iPatel
감사의 자동 레이아웃 사용해야 아이폰 OS (11)의 문제입니다 @iPatel . 이미지 뷰를 탐색 막대로 제한하거나 높이와 너비 만 설정해야합니까? – Cesare
그게 @iPatel 작동합니다. 언제든지 대답으로 게시 할 수 있습니다. – Cesare