user9606220
user9606220

Reputation:

How to add image to top layout

How to add background image on top layout the one who has back button . ive tried adding imageview on it using the drag and drop but image is hiding on the back. Anyone has an idea? Thanks

image kindly view

Upvotes: 1

Views: 91

Answers (2)

Bhavin Ramani
Bhavin Ramani

Reputation: 3219

Add background image on top layout the one who has back button

Its called NavigationBar. You can set background image by this:

self.navigationController.navigationBar.setBackgroundImage(UIImage(named: "navBG.png"), for: .default)

Edit:

how about adding a label on a navigation bar?

self.title = "My Title"

Upvotes: 1

user9606220
user9606220

Reputation:

Swift 4

 self.navigationController?.navigationBar.setBackgroundImage(UIImage(named: "Background.jpg"), for: .default)

Upvotes: 1

Related Questions