Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Appcelerator Titanium ScrollView issues
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
EHM  
View profile  
 More options Jul 2 2012, 12:35 pm
From: EHM <eric.mcgre...@gmail.com>
Date: Mon, 2 Jul 2012 09:35:35 -0700 (PDT)
Local: Mon, Jul 2 2012 12:35 pm
Subject: Appcelerator Titanium ScrollView issues

Hi all, this is my first time posting so thanks in advance.  I am working
with appcelerator Titanium on my first mobile development project for iPaid
and i was hoping that there was someone out there with with a little more
experience to help point me in the right direction on some scrollView
issues i'm having.  I'll be brief:

I'm trying to setup a scrollView that displays child views in a horizontal
layout, but that scrolls vertically.  Almost exactly like the youTube app
for ipad if you click on 'most viewed' or 'top rated'.  my problem is that
i have to set a fixed height for the scrollView, as it doesn't seem to want
to absorb the contentHeight automatically from the child views if the
layout is set to 'horizontal'.  i've tried to get around this by having the
scrollView set to vertical, and then adding a containing view for the
children, but that doesn't work either.  

if anybody has any thoughts on this it would be greatly greatly
appreciated.  I'd also love to find some other titanium developers in the
area as i think it's a really wonderful tool.  here is a sample of my code:

    var win = Ti.UI.createWindow({
        layout:'vertical',
        height:'auto'
    });

    var scrollView = Ti.UI.createScrollView({
        top:0,
        left:0,
        height:'auto',
        width:'auto',
        contentHeight:'auto',
        contentWidth:'auto',
        layout:'horizontal',
        showHorizontalScrollIndicator:false,
        showVerticalScrollIndicator:true
    });
    win.add(scrollView);

    var view = Ti.UI.createView({
        top:0,
        left:0,
        height:330,
        width:256,
        backgroundColor:'#f1f1f1'
    });
    scrollView.add(view);


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bert Grantges  
View profile  
 More options Jul 2 2012, 4:37 pm
From: Bert Grantges <be...@grantges.com>
Date: Mon, 2 Jul 2012 15:37:06 -0500
Local: Mon, Jul 2 2012 4:37 pm
Subject: Re: [Refresh Austin: 6551] Appcelerator Titanium ScrollView issues

Hey Eric -

While you can manage what your trying to do it gets pretty nasty. The best practice approach for this is using a TableView and TableViewRows.

Remember that the TableViewRow is an inherited class from a regular View. This means that you can add pretty much whatever you want to it - it does have specific child objects, but if you ignore them, they end up null and don't display. In your case, you simply want to create the TableViewRow with a horizontal layout and then just add what ever views you want to it.

Check out the example code I put together here:

https://gist.github.com/3035526

Hope this helps you out with your problem.

Bert Grantges
Appcelerator Certified Developer, Titan,  and Employee :)

On Jul 2, 2012, at 11:35 AM, EHM wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »