Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18474] IOS: Unable to make toolbar really transparent/with alpha channel

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.5.0
Fix Version/sn/a
ComponentsiOS
LabelsalphaChann, ios, opacity, toolbar, transparent
ReporterDaniel Kunzler
AssigneeUnknown
Created2015-01-26T20:10:25.000+0000
Updated2018-02-28T19:55:39.000+0000

Description

Problem

Not possible to make toolbars really transparent or with a specified alpha channel (translucent). If barColor='transparent' (Test 1), toolbar is translucent (no control over opacity). If barColor='#2fff' (Test 2), toolbar is completely opaque.

Test case 1


//Application Window Component Constructor
function ApplicationWindow() {
	//load component dependencies
	var FirstView = require('ui/common/FirstView');

	//create component instance
	var self = Ti.UI.createWindow({
		backgroundColor : '#0cf'
	});

	//construct UI
	var firstView = new FirstView();
	self.add(firstView);

	var button2 = Titanium.UI.createButton({
		title:'test',
	});
	var toolbar = Titanium.UI.iOS.createToolbar({
		items : [button2],
		barColor:'transparent',
		bottom : 0,
		borderTop : true,
		borderBottom : true
	});
	self.add(toolbar);

	return self;
}

//make constructor function the public component interface
module.exports = ApplicationWindow;

Test case 2


//Application Window Component Constructor
function ApplicationWindow() {
	//load component dependencies
	var FirstView = require('ui/common/FirstView');

	//create component instance
	var self = Ti.UI.createWindow({
		backgroundColor : '#0cf'
	});

	//construct UI
	var firstView = new FirstView();
	self.add(firstView);

	var button2 = Titanium.UI.createButton({
		title:'test',
	});
	var toolbar = Titanium.UI.iOS.createToolbar({
		items : [button2],
		barColor:'#2fff',
		bottom : 0,
		borderTop : true,
		borderBottom : true
	});
	self.add(toolbar);

	return self;
}

//make constructor function the public component interface
module.exports = ApplicationWindow;

Attachments

FileDateSize
iOS Simulator Screen Shot 26.01.2015 18.06.10.png2015-01-26T20:10:25.000+000024889
iOS Simulator Screen Shot 26.01.2015 18.09.47.png2015-01-26T20:10:25.000+000024946

Comments

  1. Daniel Kunzler 2015-01-29

    I would expect to apply alpha channel to barColor property and make the toolbar completely background transparent. Instead, the SDK/API makes the toolbar completely opaque if barColor has an alpha channel, as can be seen on the second test case and screenshot I attached before (it becomes completely white, while it should be '#2fff"). In the first test case / screenshot, if barColor is set to 'transparent', it actually becomes translucent black, not completely transparent. For instance, native Weather iOS app has a completely transparent toolbar.

JSON Source