iOS listview에서 리모트 이미지가 안나올때가 있습니다. 죽어도 안나옵니다…
레이아웃상의 최상위에 이미지가 있을때 그런 증상이 있는데 왜 인지는 모르겠고, 버그는 맞습니다…
그리고 피해가는 방법도 정리가 되어서 올려봅니다.
<ListView id="listView" class="couponListView" onItemclick="CTX.onClickCouponRow">
<!-- template -->
<Templates>
<ItemTemplate name="couponRowTemplate" class="couponRowTemplate">
<View class="couponRow" touchEnabled="false">
<View class="bannerViewWrap" touchEnabled="false">
<ImageView bindId="bannerImage" class="bannerImage" touchEnabled="false" />
<View class="favoriteWrap">
<View class="favoriteBg"/>
<ImageView bindId="favoriteImage" class="favoriteImage" touchEnabled="false" />
</View>
</View>
<View class="bottomViewWrap" touchEnabled="false">
<View class="iconView" touchEnabled="false">
<ImageView bindId="couponIcon" class="couponIcon" touchEnabled="false" />
</View>
<Label bindId="couponType" class="couponType" touchEnabled="false" />
<Label bindId="couponTitle" class="couponTitle" touchEnabled="false" />
<Label bindId="couponFrom" class="couponFrom" touchEnabled="false" />
<Label bindId="couponTo" class="couponTo" touchEnabled="false" />
</View>
</View>
</ItemTemplate>
</Templates>
<ListSection id="section" />
</ListView>
이런 코드라면 bindId="bannerImage"에 { image: _url } 을 할당했을 때 iOS에서만 이미지가 나오지 않습니다.
(이 화면은 view들이 vertical 레이아웃 인데요. composite로 해서도 어쨌든 화면에 그려질때 가장 위쪽 imageview는 나오지 않습니다.)
이 현상을 피해가는 방법은 ImageView보다 레이아웃상 위에 그려지는 물체에 bindId를 할당해주는 겁니다.
<ItemTemplate name="couponRowTemplate" class="couponRowTemplate">
<View bindId="couponRow" class="couponRow" touchEnabled="false">
<View class="bannerViewWrap" touchEnabled="false">
<ImageView bindId="bannerImage" class="bannerImage" touchEnabled="false" />
이렇게 bindId=“couponRow” 와 같이 쓰지도 않을거지만 bindId를 지정해주면 나옵니다.
왜죠!!!
이걸 Titanium프로젝트 Jira에 리포팅하고 싶은데 일단 일좀 마져하구요…