可滚动视图在加速器中无法正常显示

问题描述:

我曾在appcelerator中实现了一个可滚动视图。但仅显示第一张和最后一张图像。中间图像未加载。任何建议为什么?可滚动视图在加速器中无法正常显示

这是可滚动视图的.xml文件的代码。

<Alloy> 
    <View class="container"> 
     <View class = " HeadingClass" > 
      <Label class="headingClass" top = "0%">Scrollable View And Animation Screen</Label> 
     </View> 
     <ScrollableView class = "scrollableViewClass" id="scrollableView"> 
      <ImageView class="imgView1" id="imgViewId1"></ImageView> 
      <ImageView class="imgView2" id="imgViewId2"></ImageView> 
      <ImageView class="imgView3" id="imgViewId3"></ImageView> 
      <ImageView class="imgView4" id="imgViewId4"></ImageView> 
      <ImageView class="imgView5" id="imgViewId5"></ImageView> 
     </ScrollableView> 
     <!-- <View class="imageAnimationView" id="imageAnimation"> 
      <ImageView class="animateImageClass" id="animateImage"></ImageView> 
     </View> --> 
    </View> 
</Alloy> <Alloy> 
    <View class="container"> 
     <View class = " HeadingClass" > 
      <Label class="headingClass" top = "0%">Scrollable View And Animation Screen</Label> 
     </View> 
     <ScrollableView class = "scrollableViewClass" id="scrollableView"> 
      <ImageView class="imgView1" id="imgViewId1"></ImageView> 
      <ImageView class="imgView2" id="imgViewId2"></ImageView> 
      <ImageView class="imgView3" id="imgViewId3"></ImageView> 
      <ImageView class="imgView4" id="imgViewId4"></ImageView> 
      <ImageView class="imgView5" id="imgViewId5"></ImageView> 
     </ScrollableView> 
     <!-- <View class="imageAnimationView" id="imageAnimation"> 
      <ImageView class="animateImageClass" id="animateImage"></ImageView> 
     </View> --> 
    </View> 
</Alloy> 

这是.tss文件

".container" : { 
    backgroundColor : "lightgray" 
}, 

".headingClass" : { 
    height : "5%", 
    width : "70%", 
    font: { 
     fontFamily: 'Arial', 
     fontSize: '14%', 
     fontWeight: 'bold' 
    }, 
    textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER, 
}, 

".HeadingClass" : { 
    backgroundColor : "gray", 
    top : "5%", 
    height : "6%", 
    width : "100%" 
}, 

".scrollableViewClass" : { 
    top : "15%", 
    height : "30%", 
    width : "100%", 
    contentHeight: Ti.UI.SIZE, 
    contentWidth: Ti.UI.SIZE, 
    showPagingControl : true 
}, 

".imgView1" : { 
    image : "/Images/appceleratorImage1.png", 
    height : "100%", 
    width : "100%" 
}, 

".imgView2" : { 
    image : "/Images/appceleratorImage2.png", 
    height : "100%", 
    width : "100%" 
}, 

".imgView3" : { 
    image : "/Images/appceleratorImage3.png", 
    height : "100%", 
    width : "100%" 
}, 

".imgView4" : { 
    image : "/Images/appceleratorImage4.png", 
    height : "100%", 
    width : "100%" 
}, 

".imgView5" : { 
    image : "/Images/appceleratorImage5.png", 
    height : "100%", 
    width : "100%" 
} 

尝试把“围绕<ImageView>小号的<View>的代码。 出于测试目的,您可以给他们一个backgroundColor以查看页面是否可见。

+0

完成!我不得不重新分配值的图像属性..现在它正常工作。谢谢 !! :) – SylieC