Eureka: SliderRow layout problem on iPhone5s/4s

Created on 9 Mar 2016  路  14Comments  路  Source: xmartlabs/Eureka

Hi guys,

Great job on Eureka! I love it.

Looks like there is a layout issue with the Slider row on smaller screen sizes. See the screenshot for example:
screen shot 2016-03-09 at 18 38 58

easy help wanted SliderRow issue

Most helpful comment

Hi guys
I was having a similar problem on iPhone 6 and in the simulator, until I looked at the code in the example project and noticed that a value attribute was set on the SliderRow. When I set that in my code, the slider text appeared in the correct position. Perhaps it should be mentioned in the docs or raise an error that a value for value is needed when initialising a SliderRow.

All 14 comments

This is a pretty recent pull request I think. I had the same issue as well. For a hacky workaround, I imported the DeviceKit framework into my project, and edited the SliderRow.swift file. Did an if/else inside the SliderRow.swift class methods for iPhone 4/4S/5/5S/5C, and if the device was == to those devices, set these fields below:

textLabel?.translatesAutoresizingMaskIntoConstraints = true
detailTextLabel?.translatesAutoresizingMaskIntoConstraints = true
let metrics = [
"hPadding" : 16.0,
"vPadding" : 0.0,
"spacing" : 0.0,
]

Else, (not any of those devices), then:

textLabel?.translatesAutoresizingMaskIntoConstraints = false
detailTextLabel?.translatesAutoresizingMaskIntoConstraints = false
let metrics = [
"hPadding" : 16.0,
"vPadding" : 12.0,
"spacing" : 12.0,
]

So still looks great on anything newer than those devices....and....sorta good on the older devices. At least makes it usable.

simulator screen shot mar 5 2016 11 29 22 pm

Hopefully we can get a legitimate fix here soon.

Is here any progress on this issue to have a fix in the main branch?

I've tested it using master branch on iphone 4s and 5s and couldn't reproduce the issue.
@sash @alibasta Are you still experiencing this?

Xcode 7.3.1, Eureka master branch code. iOS 8.4 and 9.3

Please, feel free to reopen this issue if you are still experiencing this issue. A project to reproduce it will help a lot to provide a fast resolution.

Hi guys
I was having a similar problem on iPhone 6 and in the simulator, until I looked at the code in the example project and noticed that a value attribute was set on the SliderRow. When I set that in my code, the slider text appeared in the correct position. Perhaps it should be mentioned in the docs or raise an error that a value for value is needed when initialising a SliderRow.

I'm still getting this. Has this issue been solved? Note that I've only tested it on the simulator, and it's doing it for all screen sizes below 6. I checked the github changes, and it seems this may have been fixed, but its not in the cocoapods release.

Thanks @chidg ! That fixed the glitch

i have this issue in all simulators. i've added my code for people to reproduce.

import UIKit
import Eureka

class NewGroupViewController: FormViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        //Background View
        self.view.backgroundColor = UIColor("#F8F9FF")



        //Form


        form = Section("")
            <<< MultipleSelectorRow<String>() {
                $0.title = "Users"
                $0.selectorTitle = "Pick users to the group"
                $0.options = ["One","Two","Three"]
            }
            +++ Section("S酶geindstillinger")
            <<< SliderRow(){
                $0.title = "Minimum Age"
                $0.cellStyle = .value1
                $0.minimumValue = 10
                $0.maximumValue = 40
                $0.steps = 30
                let numberFormatter = NumberFormatter()
                numberFormatter.numberStyle = .none
                numberFormatter.minimumFractionDigits = 0
                $0.cell.formatter = numberFormatter

            }


    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }




}

Thanks @Fredehagelund92, your code exposes the issue, but as @chidg said setting an initial value fixes it.

I am still getting this problem. And I'd rather not set initial value because I want form.values()["sliderTag"] to give me nil in order for me to know that the user did not touch the slider. Any way we can fix the layout?

Bump. Still have this issue after hiding/showing others rows on form, even if value set
But title label going down to slider

Same here. Using the Swift3_2 branch

@mtnbarreto having this issue too (I'm up to date), isn't it supposed to be open still ?
img_5887

Same in Eureka Examples Project

@spinach, @Ziph0n & @pluckq, went to the source, fixed it for my usage, see PR #1296

Was this page helpful?
0 / 5 - 0 ratings