在调试插件过程中
index.html中的
按钮可以调用createDemo();
但是createDemo();中得uexDemo.open是怎么回调的?
function createDemo(){
alert("----");
uexDemo.open('0','120','320','416');
uexDemo在plugin.xml中写了
<?xml version="1.0" encoding="utf-8" ?>
<>
原生的代码是在uexDemo.open('0','120','320','416');这句话调用的吗?我运行的时候就这这里出问题了,回调不成功,是什么原因呢?
下边是EUExDemo类
#import "EUExDemo.h"
#import "EUtility.h"
@implementation EUExDemo
@synthesize view;
-(id)initWithBrwView:(EBrowserView *)eInBrwView
{
self = [super initWithBrwView:eInBrwView];
if (self) {
}
return self;
}
-(void)open:(NSMutableArray*)array{
NSLog(@"start open");
if ([array isKindOfClass:[NSMutableArray class]]&&[array count]>0)
{
CGFloat x = [[array objectAtIndex:0] floatValue];
CGFloat y = [[array objectAtIndex:1] floatValue];
CGFloat w = [[array objectAtIndex:2] floatValue];
CGFloat h = [[array objectAtIndex:3] floatValue];
NSLog(@"%f,%f,%f,%f",x,y,w,h);
if (!view)
{
NSLog(@"if");
view = [[UIView alloc]initWithFrame:CGRectMake(x, y, w, h)];
[view setBackgroundColor:[UIColor yellowColor]];
[EUtility brwView:meBrwView addSubview:view];
}
}
}
@end