Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

imageview on top of scrollview (inside a view)

$
0
0

Hi - I have a scrollview which is inside a "container" view. I am then trying to put a logo on top of the scroll view. In my head this should work, but when I run the app, there's simply nothing there.

I am creating the elements in the order

  1. create a view
  2. create a scrollview
  3. add elements to the scrollview
  4. create image
  5. add scrollview to view
  6. add image to view

Each has a zIndex but it's just not showing anything. Any ideas where I'm going wrong?!

var shelf = Ti.UI.createView(
        {
            height: 110,
            layout: 'vertical',
            top:30,
            zIndex:8,
            backgroundImage:'/global/images/shelf.jpg',
            touchEnabled: true
        }
    );
 
 
    var scrollView = Ti.UI.createScrollView({
      scrollType: 'horizontal',
      horizontalWrap:true,
      contentHeight:'auto',
      contentWidth:'auto',
      showHorizontalScrollIndicator:false,
      height:110,
      zIndex:9
    });
 
    shelf.add(scrollView);
 
 
    var view = Ti.UI.createView(
        {
            width:800,
            height:90,
            layout:'horizontal',
            zIndex:10
        }
    );
 
    scrollView.add(view);
 
     //add the row label
     var newLogo = Ti.UI.createImageView({
            image: '/global/images/shelf_label_bg.png',
            top:50,
            left: 0,
            width: 250,
            height: 60,
            touchEnabled: false,
            zIndex:11
         });
 
 
    //loops through and uses a function to just place an image in the scrollview (for demo purposes)
    for(var i = 0; i <= 6; i++){
    var row = createDocumentElement(i);
      view.add(row);
    }
 
    shelf.add(newLogo);
    win.add(shelf);
Thanks for any help!

My Env:

Titanium Command-Line Interface, CLI version 3.2.0, Titanium SDK version 3.2.0.GA Building for emulator: titanium_1_WVGA800 Targeting Android SDK: 18 Building for the following architectures: armeabi, armeabi-v7a, x86


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>