skip to Main Content

I am using UITableView header to add UIImageView and other labels.
But I am unable to place UIImageView in between navigation bar and UITableViewHeader. my Image is going behind navigation bar.
Pls refer the expected design screenshot. Thanks in advance. pls guide me on this.
enter image description here

2

Answers


  1. You can manually add an UIImageView in navigationBar, something like (I am using SnapKit for demo so ignore it. You can also make frame | autolayout yourself):

    let categoryImage = UIImageView(image: UIImage(named: "icon_category"))
    navigationController?.navigationBar.addSubview(categoryImage)
    categoryImage.snp.makeConstraints { make in
        make.width.height.equalTo(50)
        make.centerX.equalToSuperview()
        make.bottom.equalToSuperview().offset(25)
    }
    

    Another way is just hide default navigationbar then add your custom view instead

    Login or Signup to reply.
  2. You need to use custom navigation bar to place any object on it as we cannot customize the default navigation bar in such ways.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search