Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Scroll Pane - Device vs Simulator

Hey Guys - This was my first attempt at using the qnx scroll pane and Ive got it working nicely but am having some issues with it on the actual device. It looks and performs exactly how I expect it to in the simulator but then on the device it never shows the shadows or scrolls my content. Has anyone ever seen this behavior? I will try and post some code later, maybe theres something small that is throwing off the device.

Like all of my posts
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Scroll Pane - Device vs Simulator

Yes, please post code. I get the same behavior on both and the shadow shows up fine. Probably some small.
Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: Scroll Pane - Device vs Simulator

Thanks for the response john, this is what ive got... (at the end of all of this the scrollpane is added to a uicomponent that is already on the screen)

 

 

                                var scro:ScrollPane = new ScrollPane();
				var scrollCont:Container = new Container();
				if(!_captionText){
					var tf:TextFormat = new TextFormat('HandSean',18,0x000000);
					
					this._captionText = new qnx.ui.text.Label();
					this._captionText.autoSize = TextFieldAutoSize.LEFT;
					this._captionText.wordWrap = true;
					this._captionText.multiline = true;
					this._captionText.embedFonts = true;
					this._captionText.format = tf;
					this._captionText.textField.setTextFormat(tf);
					this._captionText.width = 260;
					var s:String = _media.user.username;
					if(_media.caption && _media.caption.text.length > 0){
						this._captionText.text = this._media.user.username + " - " + this._media.caption.text;
					} else {
						this._captionText.text = this._media.user.username + "";
					}
					scrollCont.width = 260;
					scrollCont.addChild(_captionText);
					scro.size = 100;
					scro.sizeUnit = SizeUnit.PERCENT;
					scro.setSize(260,425);
					scro.setPosition(0,0);
					scro.width = 260;
					scro.height = 425;
					scro.enableShadows = false;
				} else {
					if(_media.caption){
						this._captionText.text = this._media.user.username + " - " + this._media.caption.text;
					} else {
						this._captionText.text = this._media.user.username + "";
					}
				}
				if(!_comList && _media.commentCount > 0){
					_comList = new List();
					_comList.width = 260;
					_comList.opaqueBackground = 0xFFFFFF;
					_comList.size = 100;
					_comList.rowHeight = 90;
					_comList.sizeUnit = SizeUnit.PERCENT
					_comList.selectionMode = ListSelectionMode.NONE;
					_comList.setSkin(CommentRendererSkin);
					_comList.columnWidth = 260;
					_comList.y = _captionText.textHeight + 15;
					_comList.height = 420 - _comList.y;
					_comList.dataProvider = new DataProvider(_media.comments);
					scrollCont.addChild(_comList);
				} else {
					if(_media.commentCount > 0){
						_comList.y = _captionText.textHeight + 15;
						_comList.dataProvider = new DataProvider(_media.comments);
					}
				}
				
				scro.setScrollContent(scrollCont);
				scro.update();

 

 

Like all of my posts
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Scroll Pane - Device vs Simulator

Try commenting out your list logic and just setSize to the scrollContent object to see if scrolling works. Then you will know it has to do with how you're trying to set the size. Seems to be dependent on the number of comments in the list.
Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: Scroll Pane - Device vs Simulator

Ill give it a try. Its not really size dependent on the number of items in the list. I have a fixed height space, and I am adjusting the height and placement of the list based on how long the text above it is. Its early code but I was just a little worried when testing on device.
Like all of my posts
Contributor
Posts: 27
Registered: ‎03-31-2011
My Device: Developer
My Carrier: Developer

Re: Scroll Pane - Device vs Simulator

Did you ever end up getting this to work? I am having the same issue. It only lets you scroll on the device if you click at the very top of the scroll pane or at the very bottom.
Check out Go Studio on Blackberry App World!

http://appworld.blackberry.com/webstore/content/38912