SplitWindow widths
Hi there,
Are the width of the two panes in a SplitWindow fixed, or is it possible to change these? Adjusting the width of each window doesn't seem to have an effect, but maybe I'm doing it wrong - this is what I'm trying (adapted from the iPad kitchen sink):
SplitViewNav = {};
SplitViewNav.masterWindow = Ti.UI.createWindow({
title:'Master',
backgroundColor:'red',
width: 513
});
SplitViewNav.detailWindow = Ti.UI.createWindow({
title:'Detail',
backgroundColor:'#336699',
width: 510
});
SplitViewNav.splitView = Titanium.UI.iPad.createSplitWindow({
masterView:SplitViewNav.masterNav,
detailView:SplitViewNav.detailNav
});
Thanks,
Toby
1 Answer
-
You can set width of masterview in splitview but for that you have to change Titanium compiled code (XCODE source).
follow this steps.
Compile Titanium source code, Note that splitview must contain property
showMasterInPortrait = ture
that supported in 1.7.2 SDK. this property shows masterview in portrait mode.Open compiled source from build that is XCODE Project generated from Titanium compilation.
find file "TiUIiPadSplitWindow.m" file in XCODE source from
(Project)\Classes\Modules\UI\iOS\iPad\Split View\TiUIiPadSplitWindow.mput following code into file at line no 125
-(void)setSplitPosition_:(id)value { float splitPos = [TiUtils floatValue:value]; MGSplitViewController* splitController = (MGSplitViewController*)[self controller]; [splitController setSplitPosition:splitPos animated:YES]; [[self proxy] replaceValue:value forKey:@"splitPosition" notification:NO]; }
clean and build source code from XCODE and run the code. Note do not compile again in Titanium. whenever you clean your build you have to follow all this steps again.
use
Object.splitPosition = value
for examplesplitview.splitPosition = 500
where you want to change your masterview width in the splitview.