|
|
@@ -18,6 +18,8 @@
|
|
|
#import <QuickLook/QuickLook.h>
|
|
|
#import "config.h"
|
|
|
#import "RAConvertor.h"
|
|
|
+//#import "RTLabel.h"
|
|
|
+
|
|
|
|
|
|
static const int delta = 25;
|
|
|
|
|
|
@@ -69,7 +71,7 @@ static const int delta = 25;
|
|
|
|
|
|
// singleFingerTwo.delegate = self;
|
|
|
|
|
|
- self.label = [UILabel new];
|
|
|
+ self.label = [MDHTMLLabel new];
|
|
|
// NSString* Path = [[NSBundle mainBundle] pathForResource:@"layout.json" ofType:nil];
|
|
|
//
|
|
|
// NSData *data = [NSData dataWithContentsOfFile:Path];
|
|
|
@@ -342,8 +344,8 @@ static const int delta = 25;
|
|
|
{
|
|
|
|
|
|
NSLog(@"label touched");
|
|
|
- UILabel* label = (UILabel*)[gestureRecognizer view];
|
|
|
- self.label.text = label.text;
|
|
|
+ MDHTMLLabel* label = (MDHTMLLabel*)[gestureRecognizer view];
|
|
|
+ self.label.htmlText = label.htmlText;
|
|
|
[self.label sizeToFit];
|
|
|
if(self.label.frame.size.width>label.frame.size.width||self.label.frame.size.height>label.frame.size.height)
|
|
|
{
|
|
|
@@ -352,7 +354,10 @@ static const int delta = 25;
|
|
|
|
|
|
|
|
|
FullyShowViewController *fullVC = [ self.storyboard instantiateViewControllerWithIdentifier:@"fullyShowViewController"];
|
|
|
- fullVC.text = label.text;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ fullVC.htmlText = label.htmlText;
|
|
|
|
|
|
fullVC.preferredContentSize = CGSizeMake(200, 240);
|
|
|
|
|
|
@@ -485,6 +490,9 @@ static const int delta = 25;
|
|
|
-(NSTextAlignment) get_TextHAlign:(NSString*)textHAlign
|
|
|
{
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if([textHAlign.lowercaseString isEqualToString:@"center"])
|
|
|
return NSTextAlignmentCenter;
|
|
|
else if([textHAlign.lowercaseString isEqualToString:@"left"])
|
|
|
@@ -494,6 +502,21 @@ static const int delta = 25;
|
|
|
|
|
|
return NSTextAlignmentLeft;
|
|
|
}
|
|
|
+//-(RTTextAlignment) get_RTTextHAlign:(NSString*)textHAlign
|
|
|
+//{
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// if([textHAlign.lowercaseString isEqualToString:@"center"])
|
|
|
+// return RTTextAlignmentCenter;
|
|
|
+// else if([textHAlign.lowercaseString isEqualToString:@"left"])
|
|
|
+// return RTTextAlignmentLeft;
|
|
|
+// else if([textHAlign.lowercaseString isEqualToString:@"right"])
|
|
|
+// return RTTextAlignmentRight;
|
|
|
+//
|
|
|
+// return RTTextAlignmentLeft;
|
|
|
+//}
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
|
|
{
|
|
|
|
|
|
@@ -559,11 +582,29 @@ static const int delta = 25;
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
int width = [arr_col[i][@"width"] intValue];;
|
|
|
- UILabel *vallabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, width, height)];
|
|
|
+ MDHTMLLabel *vallabel = [[MDHTMLLabel alloc] initWithFrame:CGRectMake(x, y, width, height)];
|
|
|
vallabel.textColor=UIColorFromRGB(fcolor);//UIColor.blackColor;
|
|
|
vallabel.backgroundColor = [UIColor clearColor];
|
|
|
- vallabel.text=item[i];
|
|
|
+
|
|
|
+ NSString* text=@"";
|
|
|
+ if(i>item.count-1)
|
|
|
+ text=@"row data missing";
|
|
|
+ else
|
|
|
+ text=item[i];
|
|
|
+
|
|
|
+
|
|
|
+// RTTextLineBreakModeWordWrapping = kCTLineBreakByWordWrapping,
|
|
|
+// RTTextLineBreakModeCharWrapping = kCTLineBreakByCharWrapping,
|
|
|
+// RTTextLineBreakModeClip = kCTLineBreakByClipping,
|
|
|
+
|
|
|
+// NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:text];
|
|
|
+
|
|
|
+
|
|
|
+// vallabel.attributedText = attrStr;
|
|
|
+
|
|
|
+ vallabel.htmlText = text;
|
|
|
vallabel.textAlignment= [self get_TextHAlign:arr_col[i][@"h_align"] ];
|
|
|
|
|
|
vallabel.layer.borderWidth=0.5;
|