Skip to content

Commit

Permalink
Added iPad version to Example project
Browse files Browse the repository at this point in the history
  • Loading branch information
AliSoftware committed Sep 9, 2012
1 parent 372615d commit 135c4a1
Show file tree
Hide file tree
Showing 6 changed files with 397 additions and 8 deletions.
7 changes: 5 additions & 2 deletions GridViewExample/Classes/GridViewExampleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ -(void)viewDidLoad
@"mail",@"map",@"notes",@"photo",@"tools",@"wallpaper",@"weather",
nil];

((OHGridView*)self.view).rowHeight = 100;
((OHGridView*)self.view).rowHeight = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) ? 100 : 200;
((OHGridView*)self.view).columnsCount = 2;
}

Expand Down Expand Up @@ -62,7 +62,7 @@ -(OHGridViewCell*)OHGridView:(OHGridView *)aGridView cellAtIndexPath:(NSIndexPat
{
cell = [OHGridViewCell cell];

// First simple way to set a backgrounf
// First simple way to set a background
//cell.backgroundColor = [UIColor grayColor]; // One way

// Another way, using custom view (so you may also user an UIImageView or whatever you need
Expand All @@ -71,6 +71,9 @@ -(OHGridViewCell*)OHGridView:(OHGridView *)aGridView cellAtIndexPath:(NSIndexPat

cell.selectedBackgroundView = noarc_autorelease([[UIView alloc] initWithFrame:CGRectZero]);
cell.selectedBackgroundView.backgroundColor = [UIColor colorWithRed:0.5f green:0.5f blue:0.8f alpha:1.f];

// Customize textLabel font size
cell.textLabel.font = [UIFont systemFontOfSize:(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) ? 12 : 36];
}

NSUInteger i = [aGridView indexForIndexPath:indexPath];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ - (void)viewDidLoad
[super viewDidLoad];
// Do any additional setup after loading the view.
OHGridView* grid = (OHGridView*)self.view;
grid.columnsCount = 5;
grid.columnsCount = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) ? 5 : 8;
grid.rowHeight = 80;
}

Expand Down
2 changes: 2 additions & 0 deletions GridViewExample/GridViewExample-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
<true/>
<key>NSMainNibFile</key>
<string>MainWindow</string>
<key>NSMainNibFile~ipad</key>
<string>MainWindow-iPad</string>
</dict>
</plist>
22 changes: 17 additions & 5 deletions GridViewExample/GridViewExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/* Begin PBXBuildFile section */
090B5EBE15FD19AF0054FA12 /* GridViewPerformanceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 090B5EBD15FD19AF0054FA12 /* GridViewPerformanceViewController.m */; };
090B5EC115FD56E30054FA12 /* MainWindow-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 090B5EC015FD56E30054FA12 /* MainWindow-iPad.xib */; };
090B5EC315FD5CA90054FA12 /* Icon-iPad.png in Resources */ = {isa = PBXBuildFile; fileRef = 090B5EC215FD5CA90054FA12 /* Icon-iPad.png */; };
098D566A123022DA0055E596 /* browser-64x64.png in Resources */ = {isa = PBXBuildFile; fileRef = 098D565D123022DA0055E596 /* browser-64x64.png */; };
098D566B123022DA0055E596 /* calc-64x64.png in Resources */ = {isa = PBXBuildFile; fileRef = 098D565E123022DA0055E596 /* calc-64x64.png */; };
098D566C123022DA0055E596 /* chat-blank-64x64.png in Resources */ = {isa = PBXBuildFile; fileRef = 098D565F123022DA0055E596 /* chat-blank-64x64.png */; };
Expand All @@ -34,6 +36,8 @@
/* Begin PBXFileReference section */
090B5EBC15FD19AF0054FA12 /* GridViewPerformanceViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GridViewPerformanceViewController.h; sourceTree = "<group>"; };
090B5EBD15FD19AF0054FA12 /* GridViewPerformanceViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GridViewPerformanceViewController.m; sourceTree = "<group>"; };
090B5EC015FD56E30054FA12 /* MainWindow-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MainWindow-iPad.xib"; path = "iPad/MainWindow-iPad.xib"; sourceTree = "<group>"; };
090B5EC215FD5CA90054FA12 /* Icon-iPad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-iPad.png"; sourceTree = "<group>"; };
098D565D123022DA0055E596 /* browser-64x64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "browser-64x64.png"; sourceTree = "<group>"; };
098D565E123022DA0055E596 /* calc-64x64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "calc-64x64.png"; sourceTree = "<group>"; };
098D565F123022DA0055E596 /* chat-blank-64x64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chat-blank-64x64.png"; sourceTree = "<group>"; };
Expand All @@ -50,7 +54,7 @@
09BAC51612E255DF00C3B95B /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
09F6EC8615FD01D700A493F3 /* libOHGridView.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libOHGridView.a; sourceTree = BUILT_PRODUCTS_DIR; };
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D6058910D05DD3D006BFB54 /* GridViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GridViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
1D6058910D05DD3D006BFB54 /* GridViewTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GridViewTest.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -110,7 +114,7 @@
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* GridViewExample.app */,
1D6058910D05DD3D006BFB54 /* GridViewTest.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -141,9 +145,11 @@
isa = PBXGroup;
children = (
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
090B5EC015FD56E30054FA12 /* MainWindow-iPad.xib */,
098D565C123022DA0055E596 /* icons */,
8D1107310486CEB800E47090 /* GridViewExample-Info.plist */,
09BAC51612E255DF00C3B95B /* Icon.png */,
090B5EC215FD5CA90054FA12 /* Icon-iPad.png */,
);
name = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -175,7 +181,7 @@
);
name = GridViewExample;
productName = GridViewExample;
productReference = 1D6058910D05DD3D006BFB54 /* GridViewExample.app */;
productReference = 1D6058910D05DD3D006BFB54 /* GridViewTest.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand Down Expand Up @@ -225,6 +231,8 @@
098D5675123022DA0055E596 /* wallpaper-64x64.png in Resources */,
098D5676123022DA0055E596 /* weather-64x64.png in Resources */,
09BAC51712E255DF00C3B95B /* Icon.png in Resources */,
090B5EC115FD56E30054FA12 /* MainWindow-iPad.xib in Resources */,
090B5EC315FD5CA90054FA12 /* Icon-iPad.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -254,8 +262,10 @@
GCC_PREFIX_HEADER = GridViewExample_Prefix.pch;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "GridViewExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
LIBRARY_SEARCH_PATHS = "${TARGET_BUILD_DIR}/**";
PRODUCT_NAME = GridViewExample;
PRODUCT_NAME = GridViewTest;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/../OHGridView/**";
};
name = Debug;
Expand All @@ -268,8 +278,10 @@
GCC_PREFIX_HEADER = GridViewExample_Prefix.pch;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "GridViewExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
LIBRARY_SEARCH_PATHS = "${TARGET_BUILD_DIR}/**";
PRODUCT_NAME = GridViewExample;
PRODUCT_NAME = GridViewTest;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/../OHGridView/**";
VALIDATE_PRODUCT = YES;
};
Expand Down
Binary file added GridViewExample/Icon-iPad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 135c4a1

Please sign in to comment.