Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24820] TiAPI: Flexible width in horizontal layouts not behaving correctly

GitHub Issuen/a
TypeBug
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 6.1.0
Fix Version/sn/a
ComponentsAndroid, iOS, Windows
Labelsn/a
ReporterHans Knöchel
AssigneeUnknown
Created2017-06-14T18:04:19.000+0000
Updated2018-02-28T19:55:41.000+0000

Description

During the #titaniumDE meetup in Berlin, we had an interesting discussion around flexible box-layouts. Basically, when you have a horizontal layout, you can have the first view using a static width (like width: 100), then another view with no width specified (should Ti.UI.FILL) and then another view width a static width. Here is some Alloy demo-code:
<Alloy>
	<Window>
		<View layout="vertical">
			<View layout="horizontal" height="100">
				<View width="100" backgroundColor="#ff0000"></View>
                                <!-- Should expand but respect the view to the right with the given width -->
				<View backgroundColor="#ffff00"></View>
				<View width="100" backgroundColor="#cecece"></View>
			</View>
			<View layout="horizontal" height="100">
				<View width="20" backgroundColor="#ff0000"></View>
				<View width="100%" backgroundColor="#cecece"></View>
				<View width="40" backgroundColor="#ffff00"></View>
			</View>
		</View>
	</Window>
</Alloy>
There is also a screenshot attached. Thanks to [~mBahl] for raising this issue! This is open for discussion.

Attachments

FileDateSize
pasted_image_at_2017_06_14_12_53_pm_720.png2017-06-14T18:04:57.000+000013059

Comments

No comments

JSON Source