scrollView:scrollToBottom()

For the life of me I can not get this to work.
scrollToLeft() and scrollToRight() both work just like they should.
Anyone else have any issues with this, or know a work around.
I could not get scrollToPosition to work either, as I tried to use it instead. [import]uid: 170004 topic_id: 35715 reply_id: 335715[/import]

I’m running build 1021
I hadn’t checked the function before I updated yesterday morning so I don’t know if worked before or not… [import]uid: 170004 topic_id: 35715 reply_id: 142015[/import]

I’m not sure why these actions are not working for you. Can you post some code for us to look at?

[import]uid: 199310 topic_id: 35715 reply_id: 142042[/import]

Hi Rob,
Happy to put the code up for you

I’ve got a variable in place for the scrollView width, as I change it depending on the screen size of the device. I also was printing out the variable playerTurn to the console to make sure the right number was getting there, it is. Like I said, scrollToRight is working, so when it’s player two’s turn, it behaves and slides on over to the right side. Player one starts in the upper left so it doesn’t have to move at all. When it’s player 3’s turn, it slides over to the right, but doesn’t move to the bottom.

One thing I’m noticing is that I am calling this positioning before I actually populate my scrollview. I am not sure how I’d restructure it so as to position the scrollview correctly after the first time the map gets drawn and inserted into the scrollview, and only the first time. During any given turn, the clear the scrollview and redraw the map as many as a dozen times.

I can maybe put the positioning into a function that gets called only at the start of the players turn, if you think that will help.

Been a long day, so I won’t get to it until the morning.

[code]
local scrollView = widget.newScrollView{
width = maskWidth,
height = 320,
scrollWidth = 1000,
scrollHeight = 1000,
friction = .75,
maskFile = maskSize,
hideBackground = true,
hideScrollBar = true,
listener = scrollViewListener
}

– Locate scrollView to match playerTurn
print(playerTurn)
if playerTurn == 1 then
scrollView:scrollToTop()
scrollView:scrollToLeft()

elseif playerTurn == 2 then
scrollView:scrollToTop()
scrollView:scrollToRight()

elseif playerTurn == 3 then
scrollView:scrollToBottom()
scrollView:scrollToRight()

elseif playerTurn == 4 then
scrollView:scrollToBottom()
scrollView:scrollToLeft()
end
[/code] [import]uid: 170004 topic_id: 35715 reply_id: 142045[/import]

just an update
I made my positioning into a function and called it so it happens right after the first mapDraw()
No change. It still refuses to to scroll to the bottom.

Any advice would be great.
[import]uid: 170004 topic_id: 35715 reply_id: 142076[/import]

Should I log this as a bug then, since no one has any input on it

basically screws me and makes scrollview an unusable option for me, and it’s going to be a headache trying to create an alternative to scrollview. Sucks because I currently have just about all my game play working at this point with the scrollview, minus this one seemingly critical function [import]uid: 170004 topic_id: 35715 reply_id: 142168[/import]

I’m running build 1021
I hadn’t checked the function before I updated yesterday morning so I don’t know if worked before or not… [import]uid: 170004 topic_id: 35715 reply_id: 142015[/import]

I’m not sure why these actions are not working for you. Can you post some code for us to look at?

[import]uid: 199310 topic_id: 35715 reply_id: 142042[/import]

Hi Rob,
Happy to put the code up for you

I’ve got a variable in place for the scrollView width, as I change it depending on the screen size of the device. I also was printing out the variable playerTurn to the console to make sure the right number was getting there, it is. Like I said, scrollToRight is working, so when it’s player two’s turn, it behaves and slides on over to the right side. Player one starts in the upper left so it doesn’t have to move at all. When it’s player 3’s turn, it slides over to the right, but doesn’t move to the bottom.

One thing I’m noticing is that I am calling this positioning before I actually populate my scrollview. I am not sure how I’d restructure it so as to position the scrollview correctly after the first time the map gets drawn and inserted into the scrollview, and only the first time. During any given turn, the clear the scrollview and redraw the map as many as a dozen times.

I can maybe put the positioning into a function that gets called only at the start of the players turn, if you think that will help.

Been a long day, so I won’t get to it until the morning.

[code]
local scrollView = widget.newScrollView{
width = maskWidth,
height = 320,
scrollWidth = 1000,
scrollHeight = 1000,
friction = .75,
maskFile = maskSize,
hideBackground = true,
hideScrollBar = true,
listener = scrollViewListener
}

– Locate scrollView to match playerTurn
print(playerTurn)
if playerTurn == 1 then
scrollView:scrollToTop()
scrollView:scrollToLeft()

elseif playerTurn == 2 then
scrollView:scrollToTop()
scrollView:scrollToRight()

elseif playerTurn == 3 then
scrollView:scrollToBottom()
scrollView:scrollToRight()

elseif playerTurn == 4 then
scrollView:scrollToBottom()
scrollView:scrollToLeft()
end
[/code] [import]uid: 170004 topic_id: 35715 reply_id: 142045[/import]

just an update
I made my positioning into a function and called it so it happens right after the first mapDraw()
No change. It still refuses to to scroll to the bottom.

Any advice would be great.
[import]uid: 170004 topic_id: 35715 reply_id: 142076[/import]

Should I log this as a bug then, since no one has any input on it

basically screws me and makes scrollview an unusable option for me, and it’s going to be a headache trying to create an alternative to scrollview. Sucks because I currently have just about all my game play working at this point with the scrollview, minus this one seemingly critical function [import]uid: 170004 topic_id: 35715 reply_id: 142168[/import]