1

my designer created this layout:

enter image description here

How can I mimic that on iOS? I tried creating a Segmented Control but didn't work well because it can't be customized after iOS7. So at the moment I'm thinking about a UIPageControl with custom dots like explained here: Customize dot with image of UIPageControl at index 0 of UIPageControl

My problem is also with the concept. Segmented controls are said to be used to flatten/filter results according to iOS human guidelines while UIPageControl has actually different pages...

Is this the best approach? If so, can I make it look like the Android Tab bar?

  1. Segmented control with custom image
  2. UIPageControl with custom image
  3. UITabBar on top (read too many bad things about this approach)
  4. something else

If UIPageControl is indeed the best/correct/possible approach how can I make it look as close as the image? And also move it to the top?

Thanks!

Community
  • 1
  • 1
eestein
  • 4,914
  • 8
  • 54
  • 93
  • There are a lot of open source libraries that can handle these kind of things beautifully. If your designer is open so using something slightly different, you will likely find something on this list that can work for you: https://github.com/vsouza/awesome-ios#tab-bar – matt.writes.code Nov 17 '16 at 16:26
  • The truth is iOS does not have a control which mimics the android `ViewPager`. If you want to have such a view in your app, you would need to implement it yourself from scratch. You could probably mimic the behavior using a combination of `UICollectionView` with paging enabled, and `UIButton`s arranged to fill the width of the screen. – aeskreis Nov 17 '16 at 16:27
  • @matt.writes.code that's a pretty cool resource, but I'm using xamarin, not sure they would work for me. – eestein Nov 17 '16 at 16:29
  • @aeskreis that's interesting... would you care to elaborate that as an answer? – eestein Nov 17 '16 at 16:30

1 Answers1

1

Short answer: Don't do that. You're trying to implement Android controls on iOS. That leads to user confusion and an app that doesn't feel like a native app.

Instead, have your designer create a native app design for both platforms.

It looks to me like the closest analog to what you're trying to do is a tab bar and a tab bar controller (UITabBarController).

EDIT:

If you must implement this UI on iOS, you might have to roll your own. You'd create a new custom parent view controller with a child view controller that you could swap out, and a custom control that triggers the swapping. Conceptually it would be a lot like a tab bar controller.

You could probably set it up using a container view and an embed segue (The embedded view controller would be the starting child view controller) and then use the built-in support for managing child view controllers to swap out the child view controller when the user taps on your control. I've done this sort of thing before. It isn't that hard, and is pretty well documented.

Community
  • 1
  • 1
Duncan C
  • 128,072
  • 22
  • 173
  • 272
  • Hey, thanks. Yes I know that, believe me. I'm having some "interesting" discussions with my designer, it's kinda complicated... anyway, I'm against doing that, so I asked him to review it and create something for iOS. In his mind he created a custom app, not an Android one... Thanks for your answer. If that ends up being the only solution for this case I'll take a look at a tab bar, though as you yourself said it's not well seen. As I also mentioned in my post plenty of people said that's not correct, that's why I was looking for alternatives. Thanks. – eestein Nov 17 '16 at 16:49
  • Thanks. I'm actually going to take a stand and ask him to create a layout specific for iOS or a truly global one (that take both systems' components into account). I'm marking all the points in his layout just to prove it was developed with Android in mind. Thanks for your answer though, I'm also gonna use it as evidence ;) – eestein Nov 17 '16 at 17:05
  • Time to hire a designer who knows how to do native design for both platforms? – Duncan C Nov 17 '16 at 17:07
  • True that... that might be needed if I can't make it work with him. Thanks again for your time. :) – eestein Nov 17 '16 at 17:10