2013-03-26 65 views
0

我有2个按钮被称为previousBttnnextBttnscrollView。我在scrollView有3张图片。可见和不可见按钮时点击+相同的滚动在ScrollView ios

  1. 我想隐藏previousBttn像这样:[...]>在第一图像
  2. 当我nextBttn点击第二图像,2键会显示这样的:< [...]>
  3. 结束时,在第三图像的nextBttn将隐藏和previousBttn将显示这样的:< [...]

    过程: [...]> < [...]> < [。 ..]

而且当我们swipe所有图像都是一样的。

+0

滚动视图中的每个图像的宽度? – Balu 2013-03-26 07:26:22

+0

你可以实现你自己的逻辑,因为我们不知道你想要什么。 – Balu 2013-03-26 07:28:44

+0

是的,当我们点击上一个或下一个按钮来转到另一个图像时,它就可以工作。 – Sovannarith 2013-03-26 07:28:58

回答

1

我认为你必须自己做。您知道当前可见页面的索引和总图像数量。 if(index == 0)hidePreviousButtonORShowThis [...]>。 else if(index == totalImageCount - 1)then hideNextButton else UnhideBothButtons。

您可以使用图像这些迹象[...]> < [...] < [...]>

+0

好吧,我会尝试这个 – Sovannarith 2013-03-26 07:38:44

+0

它现在的作品,谢谢 – Sovannarith 2013-03-26 08:10:36

0
int currentIndex = 0; // set to first postion 
    // if you are at first position 
    if(currentIndex == 0) 
    { 
     // hide previous button 
    } 
    else if(currentIndex == yourImageCount) 
    { 
     // hide next button 
    } 
    else 
    { 
     // show both the buttons 
    } 
相关问题