Jawad
Code is Art
Profile
Posts: 13
Reg: Oct 30, 2011
Al-Hassa, Saudi...
2,530
06/13/12 06:59 AM (13 years ago)

Scrolling the buttons from right to left

Hi everybody, I have an app with button menu, and since the language of the app is starting from right to left (not like English), so I want to know the way from the Xcode to change the default setting of buttons scrolling (Left-right to Right-Left). Please help me in this. THX
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/13/12 05:16 PM (13 years ago)
Hmmm..we hear this from time to time but when it arrises I never remember the solution! Funny. The solution will be figuring out the order in which the buttons are displayed on the screen and figuring out which buttons are "first" and which buttons are "last." The UIScrollView that holds all the buttons doesn't care which direction is being scrolled - left or right is the same action as far as it's concerned. This just means that the layoutScreen method will need to be tweaked to place the button in the UIScrollView starting from right to left. I think?
 
Jawad
Code is Art
Profile
Posts: 13
Reg: Oct 30, 2011
Al-Hassa, Saudi...
2,530
like
06/14/12 05:45 AM (13 years ago)
Thanks David but still I could not solve it. I need only a small code to use it just to make the buttons scrolling from right to left, Bi.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/14/12 10:50 AM (13 years ago)
It's not going to be a "small code" to use to make this adjustment. It's going to take an understanding of how a UIScrollView works, how the buttons are added to it, and how to re-arrange those buttons. If I had an easy solution I would provide it - I don't. Each button is in a UIView named "buttonBox" (look at line 481). The size and position of each button box is setup on this line: UIView *buttonBox = [[UIView alloc] initWithFrame:CGRectMake(left, top, boxWidth, boxHeight)]; The left / top / width / height values are relative to the UIScrollView, not the window. You'll need to adjust these values for each button to get the results you're looking for.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.