Merge pull request #6 from alokard/master

Added background image for selected and highlighted state of the tab
This commit is contained in:
J. Brown
2012-07-03 12:04:07 -07:00
7 changed files with 118 additions and 0 deletions

View File

@@ -71,10 +71,13 @@
UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom];
b.frame = CGRectMake(buttonX, 2, buttonSize + extra, 38);
UIImage *tabBarButtonBackground = [[UIImage imageNamed:@"tabBarButtonBackground"] stretchableImageWithLeftCapWidth:1 topCapHeight:0];
UIImage *tabBarButtonBackgroundHighlighted = [[UIImage imageNamed:@"tabBarButtonBackgroundHighlighted"] stretchableImageWithLeftCapWidth:1 topCapHeight:0];
[b setImage:[info icon] forState:UIControlStateNormal];
[b setImage:[info highlightedIcon] forState:UIControlStateHighlighted];
[b setImage:[info highlightedIcon] forState:UIControlStateSelected];
[b setBackgroundImage:tabBarButtonBackground forState:UIControlStateNormal];
[b setBackgroundImage:tabBarButtonBackgroundHighlighted forState:UIControlStateHighlighted];
[b setBackgroundImage:tabBarButtonBackgroundHighlighted forState:UIControlStateSelected];
[b addTarget:self action:@selector(touchDownForButton:) forControlEvents:UIControlEventTouchDown];
[b addTarget:self action:@selector(touchUpForButton:) forControlEvents:UIControlEventTouchUpInside];

View File

@@ -50,6 +50,8 @@
E6F3962713BA366B00DF98A9 /* mentionsIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E6F3962313BA366A00DF98A9 /* mentionsIcon@2x.png */; };
E6F3962813BA366B00DF98A9 /* mentionsIconHighlighted.png in Resources */ = {isa = PBXBuildFile; fileRef = E6F3962413BA366B00DF98A9 /* mentionsIconHighlighted.png */; };
E6F3962913BA366B00DF98A9 /* mentionsIconHighlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E6F3962513BA366B00DF98A9 /* mentionsIconHighlighted@2x.png */; };
EF94DEA6159A638600406976 /* tabBarButtonBackgroundHighlighted.png in Resources */ = {isa = PBXBuildFile; fileRef = EF94DEA4159A638600406976 /* tabBarButtonBackgroundHighlighted.png */; };
EF94DEA7159A638600406976 /* tabBarButtonBackgroundHighlighted@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = EF94DEA5159A638600406976 /* tabBarButtonBackgroundHighlighted@2x.png */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -106,6 +108,8 @@
E6F3962313BA366A00DF98A9 /* mentionsIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mentionsIcon@2x.png"; sourceTree = "<group>"; };
E6F3962413BA366B00DF98A9 /* mentionsIconHighlighted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mentionsIconHighlighted.png; sourceTree = "<group>"; };
E6F3962513BA366B00DF98A9 /* mentionsIconHighlighted@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mentionsIconHighlighted@2x.png"; sourceTree = "<group>"; };
EF94DEA4159A638600406976 /* tabBarButtonBackgroundHighlighted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tabBarButtonBackgroundHighlighted.png; sourceTree = "<group>"; };
EF94DEA5159A638600406976 /* tabBarButtonBackgroundHighlighted@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tabBarButtonBackgroundHighlighted@2x.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -191,6 +195,8 @@
E6F3957813B9963B00DF98A9 /* Resources */ = {
isa = PBXGroup;
children = (
EF94DEA4159A638600406976 /* tabBarButtonBackgroundHighlighted.png */,
EF94DEA5159A638600406976 /* tabBarButtonBackgroundHighlighted@2x.png */,
E6F3962213BA366A00DF98A9 /* mentionsIcon.png */,
E6F3962313BA366A00DF98A9 /* mentionsIcon@2x.png */,
E6F3962413BA366B00DF98A9 /* mentionsIconHighlighted.png */,
@@ -303,6 +309,8 @@
E6F3962813BA366B00DF98A9 /* mentionsIconHighlighted.png in Resources */,
E6F3962913BA366B00DF98A9 /* mentionsIconHighlighted@2x.png in Resources */,
E6B0C67B142AD90100F24D54 /* LICENSE in Resources */,
EF94DEA6159A638600406976 /* tabBarButtonBackgroundHighlighted.png in Resources */,
EF94DEA7159A638600406976 /* tabBarButtonBackgroundHighlighted@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E6F3953A13B989B100DF98A9"
BuildableName = "TweetBotTabBar.app"
BlueprintName = "TweetBotTabBar"
ReferencedContainer = "container:TweetBotTabBar.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E6F3953A13B989B100DF98A9"
BuildableName = "TweetBotTabBar.app"
BlueprintName = "TweetBotTabBar"
ReferencedContainer = "container:TweetBotTabBar.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E6F3953A13B989B100DF98A9"
BuildableName = "TweetBotTabBar.app"
BlueprintName = "TweetBotTabBar"
ReferencedContainer = "container:TweetBotTabBar.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E6F3953A13B989B100DF98A9"
BuildableName = "TweetBotTabBar.app"
BlueprintName = "TweetBotTabBar"
ReferencedContainer = "container:TweetBotTabBar.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>TweetBotTabBar.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>E6F3953A13B989B100DF98A9</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB