cemolcay / SlidingContainerViewController

An android scrollable tab bar style container view controller
MIT License
217 stars 41 forks source link

Wanted to display only some portion of the screen #20

Open arshadsk5 opened 6 years ago

arshadsk5 commented 6 years ago

Hello, the library is good and very simple to implement, but in my case instead of displaying the content in fullscreen, i want to display only in some portion of the screen. screen shot 2018-05-24 at 11 06 22 am

I want to display slide in bottom of the screen , above sliding view i will be having calendar.

when i try to do the changes, the slide looks as below.

screen shot 2018-05-24 at 11 09 37 am

I have drag and drop a uiview and given outlet as customview and writing the code as below.

customView.addSubview(slidingContainerViewController.view)

-> it is leaving some space from custom view top. -> the sliding content should be display under that view

Please help it is urgent requirement.

Thanks in advance.

cemolcay commented 6 years ago

Hi, thanks. You can embed the sliding view controller in a ContainerView and you can set the size of ContainerView freely in your storyboard. If you have not experienced with ContainerView's, you can read this tutorial: https://useyourloaf.com/blog/container-view-controllers/

On 24 May 2018, at 08:38, arshadsk5 notifications@github.com wrote:

Hello, the library is good and very simple to implement, but in my case instead of displaying the content in fullscreen, i want to display only in some portion of the screen. https://user-images.githubusercontent.com/24600303/40466309-a2ce0b20-5f42-11e8-9c01-06a379b7f854.png I want to display slide in bottom of the screen , above sliding view i will be having calendar.

Please help it is urgent requirement.

Thanks in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cemolcay/SlidingContainerViewController/issues/20, or mute the thread https://github.com/notifications/unsubscribe-auth/ACTreiEJeDLUFFvfhqDiY9sxrYDJSHRVks5t1kdTgaJpZM4ULmCJ.

arshadsk5 commented 6 years ago

Thanks for your quick reply, i am very much impressed. I will check that using containerviews, then what about the top space?

arshadsk5 commented 6 years ago

I used the containers, i can display multiple views, but the problem is i am getting space from top of the view.

screen shot 2018-05-24 at 11 47 39 am

i have drag and drop a view, given outlet as custom view. Under that custom view i placed my two container views.

 let vc1 = getViewController(name: "ViewController1", onStoryboard: "Main")
 let vc2 = getViewController(name: "ViewController2", onStoryboard: "Main")
 let slidingContainerViewController = SlidingContainerViewController (
  parent: self,
  contentViewControllers: [vc1, vc2],
  titles: ["First","Second"])
customView.addSubview(slidingContainerViewController.view)

Viewcontroller1 & 2 are my containers.

If i am changing this code to ,

view.addSubview(slidingContainerViewController.view) , mainView then it displaying properly.

Please help , it is urgent requirement.

arshadsk5 commented 6 years ago

Please check the hierarchy ,

screen shot 2018-05-24 at 12 30 17 pm