math people - looking for some help here

Status
Not open for further replies.

purbeast0

No Lifer
Sep 13, 2001
53,424
6,270
126
i'm working on updating an app for iOS 9 and for some reason the layout is completely screwed up on iOS 8 vs iOS 9 on the iPhone 6. it is like the iOS 8 stuff is scaling it to fit the graphic sizes, but the iOS 9 stuff isn't.

so i'm trying to basically calculate the table height when in iOS 9 based on scaling it. here is an image of what i'm trying to do and i'll explain after:

http://imgur.com/FZz76BI.jpg

so on the left is the res that i want it to scale to be similar to. on the right i want to solve for X based on the values for a,b,c in there. HOWEVER ... a is going to be a dynamic value, it isn't ALWAYS going to be 60 as in that example. the tables on my first 2 views have height of 60 (for what i want) but when it stays height 60 on iOS 9, it's not wide enough and screws up the look.

so right now i'm having a big brain fart on how to solve for x. when the height is always 60 for the first 2 screens, i'm just doing height = (677.0 * 60.0) / 568.0 and it's working, however when i try to use that dynamically for the 60 value, it doesn't work. i know i have to incorporate the width in there as well, but trying to think with a 6 month old right next to me screaming and playing, i'm having a big brain fart and haven't figured it out yet.
 

purbeast0

No Lifer
Sep 13, 2001
53,424
6,270
126
omg i think i just realized how fucking basic this is...

a/b = x/y

EDIT:

nope that didn't quite work because the ratio of the actual screen isn't quite the same. i think it just works out for a = 60 just out of sheer luck.
 
Last edited:

BxgJ

Golden Member
Jul 27, 2015
1,054
123
106
omg i think i just realized how fucking basic this is...

a/b = x/y

EDIT:

nope that didn't quite work because the ratio of the actual screen isn't quite the same. i think it just works out for a = 60 just out of sheer luck.

X/Z=A/C so X = AZ/C

If I understand you correctly.
 

purbeast0

No Lifer
Sep 13, 2001
53,424
6,270
126
X/Z=A/C so X = AZ/C

If I understand you correctly.

yeah that is what i was initially doing, and i think that works as does my other one up above, however the width wasn't auto-scaling like it was with the first 2 pages in my app so i thought it was wrong, but once i realized that and fixed that, it appears to be working as expected.
 
Status
Not open for further replies.