image slider

You must Login before you can answer or comment on any questions.

Hello,

I would like to know how i can slide some picture in 1 view. I put all picture in a table, change the backgroud image with the table.

This ok.

But after how can i make a slid every 4s ?

— asked 10 months ago by Rebmann Guillaume
1 Comment
  • Hi,can u please put peace of your code or should clearify what you are trying to do so that we can help you out.

    — commented 10 months ago by Moiz Chhatriwala

4 Answers

hello, if you are using tableview and if you want autoslide then use

totalrows = tablview.data.length;
i=0;
 setInterval ( "doSomething()", 4000 ); // runs every 4 seconds
 
function doSomething ( )
{
  if(i<totalrows)
{
    tableview.scrollToIndex(i);
    i++;
} 
else
   i=0;
}

— answered 10 months ago by Moiz Chhatriwala
answer permalink
1 Comment
  • If you are using scrollview than you can use scrollview.toScroll(x,y); in doSomething function. here x,y are points of coordinates , you can keep increasing value of y.

    Hopes this helps you out...

    — commented 10 months ago by Moiz Chhatriwala

Hi,

it's exactaly what i need but i have a problem, it's not "sliding" automaticly ...

scrollToIndex work but not setInterval :s

Sorry, it's my mistake ... totalrow =1 ... so the soft can try to slide 1 image ^^

HI Rebmann, putting a peace of code would be easier to understand the solution but, you can try using setTimeout function, and in that fire event for table view to scroll or swipe as per your logic.

That a good question try putting the solution which work for you.

Your Answer

Think you can help? Login to answer this question!