Skip to content

Instantly share code, notes, and snippets.

@stereoket

stereoket/app.js Secret

Created Apr 13, 2012
Embed
What would you like to do?
Scroll View Bug with font
var win = Ti.UI.createWindow({
backgroundColor : 'white',
title : 'Scroll View Bug',
titleid : 'win',
barColor : '#000', // Will Effect the colour of the navbar buttons and text.
navBarHidden : false
});
var tabGroup = Ti.UI.createTabGroup({
id : 'tabgroup',
tabBarVisible : true
});
var tab = Ti.UI.createTab({
window : win,
id : 'win',
title : 'tab'
});
tabGroup.addTab(tab);
tabGroup.setActiveTab(0);
var sView = Ti.UI.createScrollView({
width : '100%',
showVerticalScrollIndicator : true,
showHorizontalScrollIndicator : false,
verticalBounce : false,
contentHeight : 'auto',
top : 0
});
var detailView = Ti.UI.createView({
height : Ti.UI.SIZE,
width : Ti.Platform.displayCaps.platformWidth,
left : 0,
top : 0
});
sView.add(detailView);
var text = 'Last year we held a parade at Easter. It was so much fun we \r\nare doing it again!\r\nSo, put on your favourite film, game, TV or literary character \r\ncostume and join us on the Southbank for our own take on the \r\nEaster Parade.\r\nCosplayers, zombies, stormtroopers, steampunks, \r\ndaywalkers, superheroes come join us.\r\nTaking part is free and there will be spot prizes for the best \r\ndressed and an exclusive after-party in the Blue Room at the \r\nBFI. The first 100 people to register will automatically get a \r\nwristband, allowing them to come to the after-party in the BFI \r\nBlue Room!';
var label = Ti.UI.createLabel({
height : Ti.UI.SIZE,
top : 320,
// font: {fontSize: 14},
width : 300,
text : text
});
detailView.add(label);
tabGroup.open();
win.add(sView);
@stereoket

This comment has been minimized.

Copy link
Owner Author

@stereoket stereoket commented Apr 13, 2012

uncommenting the font property will cause the scroll sizing to fail on iOS.

@stereoket

This comment has been minimized.

Copy link
Owner Author

@stereoket stereoket commented Apr 13, 2012

If you use this for the text var it fails from the start:

var text = "So many of today’s creative, technical, and cultural talent are, in one way or another, indebted to the little machine that plugged into the living room telly.We’re celebrating the Spectrum’s anniversary in HORIZONS, at the BFI: a rich blend of fun, memories, and future-gazing. Play some of your favourite games (you’re welcome to bring your Kempston interface and Quickshot II).";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment