简体   繁体   中英

Toolbar position changing from bottom to top of view controller

I am displaying an image on the bottom of which three buttons (Like, Comment and Dislike) are shown on a UIToolBar. When clicked on the button a popup is shown listing the number of comments or like or dislikes. The popup is a xib file, after showing the popup the toolbar is miss placed and is shown on the top of the view controller.Tool bar is miss placed as soon when the popup is shown Please help me on this.

I am not entirely sure what the problem is, try to edit your post and give it some love:)

But to me it sounds like you are not dismissing the popout entirely, if it is a UIViewController try:

self.dismiss(animated: true, completion: nil)

If you are adding it as a child view try:

yourViewController.willMove(toParentViewController: nil)
yourViewController.view.removeFromSuperview()
yourViewController.removeFromParentViewController()

Open your storyboard file.
Select toolbar and add bottom constraints, left constraints, right constraints and height constraints .
Then the toolbar will be in place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM