Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-746] buttons in toolbar and nav bar don't support background color

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:54:07.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.3.0
ComponentsiOS
Labelsn/a
ReporterNolan Wright
AssigneeBlain Hamon
Created2011-04-15T02:35:36.000+0000
Updated2011-04-17T01:54:07.000+0000

Description

self-explanatory (from premium support)

Comments

  1. Stephen Tramer 2011-04-15

    Bad news: Apple's L&F completely dominates the background color for nav and toolbar items. Once a button or other object is turned into a UIBarButtonItem of any type, there's no longer a way to access its background color properties (or CALayer, or anything of the sort, it appears). Even calling -[UIBarButtonItem initWithCustomView:] overrides these original settings.

    However you can apparently set background images on nav/toolbar buttons, which means that it would be possible to create a button image with the background color of your choice, and use the background caps to ensure that it sizes properly.

    We currently do not support background images in nav/toolbar items; changing the request so that we can support those, and then users can 'roll their own'.

  2. Jeff Haynie 2011-04-15

    (from [4190547da9df7e53a73df9d84a5cae5c0b9a2c09]) Closes #746: Buttons now support background images. See the ticket for caveats. http://github.com/appcelerator/titanium_mobile/commit/4190547da9df7e53a73df9d84a5cae5c0b9a2c09"> http://github.com/appcelerator/titanium_mobile/commit/4190547da9df7...

  3. Stephen Tramer 2011-04-15

    CAVEATS:

    • You cannot use backButtonTitleImage. Instead set the image: property of the button.
    • You MUST specify a width and height. 'auto' does not work because of how the computations are performed.
    • The button must have a 'click' listener. Things are not handled automatically.

    A hotfix is being submitted to allow both images and backgrounds on buttons.

JSON Source