|
@@ -10,8 +10,9 @@
|
|
|
#define DEF_CELL_HEIGHT 44
|
|
#define DEF_CELL_HEIGHT 44
|
|
|
#define DEF_TABLE_HEIGHT 44
|
|
#define DEF_TABLE_HEIGHT 44
|
|
|
#define LINE_WIDTH 0
|
|
#define LINE_WIDTH 0
|
|
|
-#define CELL_MARGIN 0
|
|
|
|
|
-#define LABEL_MARGIN 5
|
|
|
|
|
|
|
+#define CELL_MARGIN 15
|
|
|
|
|
+#define LABEL_MARGIN 0
|
|
|
|
|
+#define NEW_MAPCELL_MARGIN 8
|
|
|
#import "TabBarController.h"
|
|
#import "TabBarController.h"
|
|
|
#import "DetailCellTracking.h"
|
|
#import "DetailCellTracking.h"
|
|
|
#import <QuickLook/QuickLook.h>
|
|
#import <QuickLook/QuickLook.h>
|
|
@@ -478,63 +479,122 @@
|
|
|
}
|
|
}
|
|
|
else if([type isEqualToString:@"mapping"])
|
|
else if([type isEqualToString:@"mapping"])
|
|
|
{
|
|
{
|
|
|
- float width = tableView.frame.size.width;
|
|
|
|
|
- width-=CELL_MARGIN*2;
|
|
|
|
|
- CGSize constraintkey = CGSizeMake(width*0.4-2*LABEL_MARGIN, 20000.0f);//key label width is 40% cell width;
|
|
|
|
|
- CGSize constraintval = CGSizeMake(width*0.6-2*LABEL_MARGIN, 20000.0f);//val label width is 60% cell width;
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+// NSString *CellIdentifier = @"detail_item_kvnew";
|
|
|
|
|
+// DetailCellKVNew *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
|
NSDictionary* item = [self.content get_item_seg:indexPath.section row:indexPath.row];
|
|
NSDictionary* item = [self.content get_item_seg:indexPath.section row:indexPath.row];
|
|
|
NSString* key =[item allKeys][0];
|
|
NSString* key =[item allKeys][0];
|
|
|
// [cell.keyLabel sizeToFit];
|
|
// [cell.keyLabel sizeToFit];
|
|
|
NSString* val=[item valueForKey:key];
|
|
NSString* val=[item valueForKey:key];
|
|
|
|
|
+
|
|
|
if([val isEqual:[NSNull null]])
|
|
if([val isEqual:[NSNull null]])
|
|
|
val=@"";
|
|
val=@"";
|
|
|
- if(val==nil)
|
|
|
|
|
- val=@"";
|
|
|
|
|
- if([val isEqualToString:@"null"])
|
|
|
|
|
- val=@"";
|
|
|
|
|
|
|
+// cell.keyLabel.text = key;
|
|
|
|
|
+// cell.valLabel.htmlText = val;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
+// UILabel* l = [UILabel new];
|
|
|
|
|
+// l.text =@"Place_Of_Receipt";
|
|
|
|
|
|
|
|
|
|
+// CGSize size= [l sizeThatFits:CGSizeMake(116,MAXFLOAT)];
|
|
|
|
|
|
|
|
- CGRect frame;
|
|
|
|
|
- frame.size = constraintval;
|
|
|
|
|
- frame.origin.x=0;
|
|
|
|
|
- frame.origin.y=0;
|
|
|
|
|
- RTLabel* rtlabel = [[RTLabel alloc] initWithFrame:frame];
|
|
|
|
|
- [rtlabel setLineBreakMode: RTTextLineBreakModeWordWrapping];
|
|
|
|
|
- // rtlabel.lineSpacing = 20.0;
|
|
|
|
|
- [rtlabel setText: val];
|
|
|
|
|
- CGSize sizeval=rtlabel.optimumSize;
|
|
|
|
|
|
|
+ float width = tableView.frame.size.width;
|
|
|
|
|
+// width-=CELL_MARGIN*2;
|
|
|
|
|
+ CGSize constraintkey = CGSizeMake(width*0.4-2*NEW_MAPCELL_MARGIN, MAXFLOAT);//key label width is 40% cell width;
|
|
|
|
|
+ CGSize constraintval = CGSizeMake(width*0.6-2*NEW_MAPCELL_MARGIN, MAXFLOAT);//val label width is 60% cell width;
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ NSLineBreakByWordWrapping = 0, // Wrap at word boundaries, default
|
|
|
|
|
+ NSLineBreakByCharWrapping, // Wrap at character boundaries
|
|
|
|
|
+ NSLineBreakByClipping, // Simply clip
|
|
|
|
|
+ NSLineBreakByTruncatingHead, // Truncate at head of line: "...wxyz"
|
|
|
|
|
+ NSLineBreakByTruncatingTail,
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
- CGSize sizekey = [key sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
|
|
|
|
|
- // CGSize sizeval = [val sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintval lineBreakMode:NSLineBreakByWordWrapping];
|
|
|
|
|
- float height = MAX(sizekey.height,sizeval.height);
|
|
|
|
|
|
|
+ UIFont * F1=[UIFont systemFontOfSize:13];
|
|
|
|
|
+
|
|
|
|
|
+ UIFont * F2=[UIFont fontWithName:@".SFUIText-Bold" size:13];//[UIFont boldSystemFontOfSize:13];
|
|
|
|
|
+// [UILabel setFont:];
|
|
|
|
|
+ MDHTMLLabel* keylabel = [MDHTMLLabel new];
|
|
|
|
|
+ keylabel.font = F2;
|
|
|
|
|
+ keylabel.numberOfLines = 0;
|
|
|
|
|
+ keylabel.lineBreakMode = NSLineBreakByTruncatingTail;
|
|
|
|
|
+ keylabel.frame = CGRectMake(0, 0, constraintkey.width, constraintkey.height);
|
|
|
|
|
+ keylabel.text=key;
|
|
|
|
|
+ CGSize calkeysize= [keylabel sizeThatFits:constraintkey];
|
|
|
|
|
+ if([key isEqualToString:@"Place_Of_Delivery"])
|
|
|
|
|
+ {
|
|
|
|
|
+ int abc=0;
|
|
|
|
|
+ }
|
|
|
|
|
+// [keylabel sizeToFit];
|
|
|
|
|
+// CGRect r = keylabel.frame;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ MDHTMLLabel* vallabel = [MDHTMLLabel new];
|
|
|
|
|
+ vallabel.font = F1;
|
|
|
|
|
+ vallabel.numberOfLines = 0;
|
|
|
|
|
+ vallabel.lineBreakMode = NSLineBreakByWordWrapping;
|
|
|
|
|
+ vallabel.htmlText=val;
|
|
|
|
|
+ vallabel.frame = CGRectMake(0, 0, constraintval.width, constraintval.height);
|
|
|
|
|
+ CGSize calvalsize= [vallabel sizeThatFits:constraintval];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ float height = MAX(calkeysize.height,calvalsize.height)+NEW_MAPCELL_MARGIN*2;
|
|
|
height = MAX(height+LINE_WIDTH, DEF_CELL_HEIGHT);
|
|
height = MAX(height+LINE_WIDTH, DEF_CELL_HEIGHT);
|
|
|
|
|
|
|
|
- /*
|
|
|
|
|
- NSString *text = [items objectAtIndex:[indexPath row]];
|
|
|
|
|
-
|
|
|
|
|
- CGSize constraint = CGSizeMake(CELL_CONTENT_WIDTH - (CELL_CONTENT_MARGIN * 2), 20000.0f);
|
|
|
|
|
-
|
|
|
|
|
- CGSize size = [text sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap];
|
|
|
|
|
-
|
|
|
|
|
- CGFloat height = MAX(size.height, 44.0f);
|
|
|
|
|
-
|
|
|
|
|
- return height + (CELL_CONTENT_MARGIN * 2);
|
|
|
|
|
- */
|
|
|
|
|
- // NSString *CellIdentifier = @"detail_item_kv";
|
|
|
|
|
- // DetailCellKV *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
|
|
|
- // NSDictionary* item = [self.content get_item_seg:indexPath.section row:indexPath.row];
|
|
|
|
|
- // cell.keyLabel.text=[item allKeys][0];
|
|
|
|
|
- // [cell.keyLabel sizeToFit];
|
|
|
|
|
- // cell.valLabel.text= [item valueForKey:cell.keyLabel.text];
|
|
|
|
|
- // [cell.valLabel sizeToFit];
|
|
|
|
|
- //
|
|
|
|
|
- // return MAX(cell.keyLabel.frame.size.height,cell.valLabel.frame.size.height);
|
|
|
|
|
return height;
|
|
return height;
|
|
|
|
|
+//
|
|
|
|
|
+// NSDictionary* item = [self.content get_item_seg:indexPath.section row:indexPath.row];
|
|
|
|
|
+// NSString* key =[item allKeys][0];
|
|
|
|
|
+// // [cell.keyLabel sizeToFit];
|
|
|
|
|
+// NSString* val=[item valueForKey:key];
|
|
|
|
|
+// if([val isEqual:[NSNull null]])
|
|
|
|
|
+// val=@"";
|
|
|
|
|
+// if(val==nil)
|
|
|
|
|
+// val=@"";
|
|
|
|
|
+// if([val isEqualToString:@"null"])
|
|
|
|
|
+// val=@"";
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// CGRect frame;
|
|
|
|
|
+// frame.size = constraintval;
|
|
|
|
|
+// frame.origin.x=0;
|
|
|
|
|
+// frame.origin.y=0;
|
|
|
|
|
+// RTLabel* rtlabel = [[RTLabel alloc] initWithFrame:frame];
|
|
|
|
|
+// [rtlabel setLineBreakMode: RTTextLineBreakModeWordWrapping];
|
|
|
|
|
+// // rtlabel.lineSpacing = 20.0;
|
|
|
|
|
+// [rtlabel setText: val];
|
|
|
|
|
+// CGSize sizeval=rtlabel.optimumSize;
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// CGSize sizekey = [key sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
|
|
|
|
|
+// // CGSize sizeval = [val sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintval lineBreakMode:NSLineBreakByWordWrapping];
|
|
|
|
|
+// float height = MAX(sizekey.height,sizeval.height);
|
|
|
|
|
+// height = MAX(height+LINE_WIDTH, DEF_CELL_HEIGHT);
|
|
|
|
|
+//
|
|
|
|
|
+// /*
|
|
|
|
|
+// NSString *text = [items objectAtIndex:[indexPath row]];
|
|
|
|
|
+//
|
|
|
|
|
+// CGSize constraint = CGSizeMake(CELL_CONTENT_WIDTH - (CELL_CONTENT_MARGIN * 2), 20000.0f);
|
|
|
|
|
+//
|
|
|
|
|
+// CGSize size = [text sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap];
|
|
|
|
|
+//
|
|
|
|
|
+// CGFloat height = MAX(size.height, 44.0f);
|
|
|
|
|
+//
|
|
|
|
|
+// return height + (CELL_CONTENT_MARGIN * 2);
|
|
|
|
|
+// */
|
|
|
|
|
+// // NSString *CellIdentifier = @"detail_item_kv";
|
|
|
|
|
+// // DetailCellKV *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
|
|
|
+// // NSDictionary* item = [self.content get_item_seg:indexPath.section row:indexPath.row];
|
|
|
|
|
+// // cell.keyLabel.text=[item allKeys][0];
|
|
|
|
|
+// // [cell.keyLabel sizeToFit];
|
|
|
|
|
+// // cell.valLabel.text= [item valueForKey:cell.keyLabel.text];
|
|
|
|
|
+// // [cell.valLabel sizeToFit];
|
|
|
|
|
+// //
|
|
|
|
|
+// // return MAX(cell.keyLabel.frame.size.height,cell.valLabel.frame.size.height);
|
|
|
|
|
+// return height;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -775,6 +835,7 @@
|
|
|
else if([type isEqualToString:@"mapping"])
|
|
else if([type isEqualToString:@"mapping"])
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
+
|
|
|
NSString *CellIdentifier = @"detail_item_kvnew";
|
|
NSString *CellIdentifier = @"detail_item_kvnew";
|
|
|
DetailCellKVNew *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
DetailCellKVNew *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
|
NSDictionary* item = [self.content get_item_seg:indexPath.section row:indexPath.row];
|
|
NSDictionary* item = [self.content get_item_seg:indexPath.section row:indexPath.row];
|
|
@@ -782,10 +843,16 @@
|
|
|
// [cell.keyLabel sizeToFit];
|
|
// [cell.keyLabel sizeToFit];
|
|
|
NSString* val=[item valueForKey:key];
|
|
NSString* val=[item valueForKey:key];
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+// if([val isEqual:[NSNull null]])
|
|
|
|
|
+// val=@"";
|
|
|
cell.keyLabel.text = key;
|
|
cell.keyLabel.text = key;
|
|
|
cell.valLabel.htmlText = val;
|
|
cell.valLabel.htmlText = val;
|
|
|
|
|
|
|
|
|
|
+ if([key isEqualToString:@"Place_Of_Delivery"])
|
|
|
|
|
+ {
|
|
|
|
|
+ int abc=0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
NSLog(@"key %@ val %@",key,val);
|
|
NSLog(@"key %@ val %@",key,val);
|
|
|
|
|
|
|
|
// UIView * lineview = [[LineView alloc] initWithFrame:cell.contentView.frame];
|
|
// UIView * lineview = [[LineView alloc] initWithFrame:cell.contentView.frame];
|