JMC layout problem on iPhone 5

I've integrated JMC on an iPhone 5 and am experiencing layout problems.

Any suggestions on how I can fix this?

2 answers

1 accepted

I found the problem. In `JMCViewController.m` they hardcode the size of the text view. This is bad practice and should be fixed.

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
        CGRect newFrame = self.view.bounds;
        if (UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) {
            newFrame.size.height = 200;
        }
        else {
            newFrame.size.height = 106;
        }

        self.descriptionField.superview.frame = newFrame;
        self.countdownView.center = self.descriptionField.center;
    }

<body></body>

Based on your question/answer I've created a pull request that fixes this. Basically instead of having a hardcoded value for the height that depends of orientation and device we take the current height and subtract the height of the keyboard.

https://bitbucket.org/atlassian/jiraconnect-ios/pull-request/13/fix-jmcviewcontroller-layout-issue-in-the/diff

Your fix might fix the issue now but you shouldn't hard code the keyboard size. Does your solution work for iPad (try it and it wont), the keyboard size is different. Also what about landscape orientation?

I tested it on the iPad simulator and it worked fine as the layout in the iPad is different (the buttons are in the top right of the view), check line 214 to 220: https://bitbucket.org/rvillarreal/jiraconnect-ios/src/a5f1b02b723d/JIRAConnect/JMCClasses/Base/JMCViewController.m

You are right, I read that the keyboard height was the same for both orientations but it turned out it's not. I'll update it.

I've updated the pull request. Thanks for the feedback! It was my bad not double checking the keyboard size in the different orientations.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,788 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot