【发布时间】:2016-05-10 13:22:25
【问题描述】:
我很难为 Titanium/Appc 创建一个 IOS 模块,我正在尝试集成 https://github.com/antiguab/BAFluidView,以便我可以在钛中使用它。
我已按照模块教程进行操作,仅使用标准视图即可正常工作,但是当我尝试添加 BAFluidView 时,它不起作用。
我已经在 xcode 中包含了这些类,并且有下面的代码。
#import "ComExampleFluidView.h"
#import "TiUtils.h"
#import "BAFluidView.h"
#import "UIColor+ColorWithHex.h"
@implementation ComExampleFluidView
- (void)initializeState
{
// Creates and keeps a reference to the view upon initialization
square = [[UIView alloc] initWithFrame:[self frame]];
BAFluidView *view = [[BAFluidView alloc] initWithFrame:view.frame];
[view fillTo:@1.0];
view.fillColor = [UIColor colorWithHex:0x397ebe];
[view startAnimation];
[square addSubview:view];
[self addSubview:square];
[super initializeState];
}
-(void)dealloc
{
// Deallocates the view
RELEASE_TO_NIL(square);
[super dealloc];
}
-(void)frameSizeChanged:(CGRect)frame bounds:(CGRect)bounds
{
// Sets the size and position of the view
[TiUtils setView:square positionRect:bounds];
}
-(void)setColor_:(id)color
{
// Assigns the view's background color
square.backgroundColor = [[TiUtils colorValue:color] _color];
}
@end
头文件是
#import "TiUIView.h"
@interface ComExampleFluidView: TiUIView {
UIView *square;
}
@end
谁能给点建议?
【问题讨论】:
标签: ios module appcelerator appcelerator-titanium