diff --git a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate index 162693172727ad0697ad5ef62bfda1df3108aa2a..a8863406b0cdbd68135ff9251fbb69b874bda2b4 100644 Binary files a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate and b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m b/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m index 3b1c233887fa131e3b01fa916995d62d38d2495b..dc7bc0826fe279963258b3fce746c7fda5c68cae 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m +++ b/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m @@ -142,6 +142,11 @@ } #pragma mark - Table View (Properties) +- (NSDictionary *)propertiesAtIndexPath:(NSIndexPath *)indexPath +{ + NSDictionary *properties = [self.detailItem.properties objectAtIndex: [indexPath indexAtPosition: 1]]; + return properties; +} - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { @@ -158,12 +163,37 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Property" forIndexPath:indexPath]; // This only works in iOS 6, + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Property" forIndexPath: indexPath]; // This only works in iOS 6, // UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"]; // iOS5 [self configureCell:cell atIndexPath:indexPath]; return cell; } +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSDictionary *properties = [self propertiesAtIndexPath: indexPath]; + NSString *label = [properties valueForKey: @"key"]; + NSString *value = [properties valueForKey: @"value"]; + + // Font and size obtained from the storyboard + CGFloat labelFontSize = 12.f; + CGFloat valueFontSize = 15.f; + CGFloat veryLargeHeight = 2000.f; + CGFloat labelWidth = 100.f; + CGSize labelSize = + [label + sizeWithFont: [UIFont systemFontOfSize: labelFontSize] + constrainedToSize: CGSizeMake(labelWidth, veryLargeHeight) + lineBreakMode: NSLineBreakByWordWrapping]; + CGSize valueSize = + [value + sizeWithFont: [UIFont systemFontOfSize: valueFontSize] + constrainedToSize: CGSizeMake(tableView.frame.size.width - labelWidth, veryLargeHeight) + lineBreakMode: NSLineBreakByWordWrapping]; + CGFloat height = MAX(labelSize.height, MAX(valueSize.height, 44.0f)); + return height; +} + - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return NO; @@ -187,9 +217,10 @@ - (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath { if (!self.detailItem) return; - NSDictionary *object = [self.detailItem.properties objectAtIndex: [indexPath indexAtPosition: 1]]; - cell.textLabel.text = [object valueForKey:@"key"]; - cell.detailTextLabel.text = [object valueForKey:@"value"]; + NSDictionary *properties; + properties = [self propertiesAtIndexPath: indexPath]; + cell.textLabel.text = [properties valueForKey: @"key"]; + cell.detailTextLabel.text = [properties valueForKey: @"value"]; } #pragma mark - Status Updates diff --git a/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard b/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard index 75f7e00bb6987e6c82b229825c292ed64868ef10..2aa74b0bae951c94a5c3f4ee2392c6c419a2da1a 100644 --- a/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard +++ b/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard @@ -245,28 +245,6 @@ <point key="canvasLocation" x="-366" y="248"/> </scene> </scenes> - <classes> - <class className="CISDOBDetailViewController" superclassName="UIViewController"> - <source key="sourceIdentifier" type="project" relativePath="./Classes/CISDOBDetailViewController.h"/> - <relationships> - <relationship kind="outlet" name="identifierLabel" candidateClass="UILabel"/> - <relationship kind="outlet" name="propertiesTableView" candidateClass="UITableView"/> - <relationship kind="outlet" name="statusLabel" candidateClass="UILabel"/> - <relationship kind="outlet" name="summaryHeaderLabel" candidateClass="UILabel"/> - <relationship kind="outlet" name="summaryLabel" candidateClass="UILabel"/> - <relationship kind="outlet" name="webView" candidateClass="UIWebView"/> - </relationships> - </class> - <class className="CISDOBMasterViewController" superclassName="UITableViewController"> - <source key="sourceIdentifier" type="project" relativePath="./Classes/CISDOBMasterViewController.h"/> - <relationships> - <relationship kind="outlet" name="browseTableView" candidateClass="UITableView"/> - </relationships> - </class> - <class className="NSLayoutConstraint" superclassName="NSObject"> - <source key="sourceIdentifier" type="project" relativePath="./Classes/NSLayoutConstraint.h"/> - </class> - </classes> <simulatedMetricsContainer key="defaultSimulatedMetrics"> <simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/> <simulatedOrientationMetrics key="orientation"/>