小编Bro*_*nix的帖子

VideoJS 4.0插件:如何正确添加项目到controlBar?

我正在寻找videojs插件的新API:https://github.com/videojs/video.js/blob/master/docs/plugins.md

有没有正确的方法将项目添加到控制栏?我想添加'推文','喜欢'和其他各种各样的按钮.

到目前为止,我已经试图完成这项任务无济于事.

我确实查看了新的插件示例.这些都不会修改控制栏.

谢谢!

video.js

12
推荐指数
1
解决办法
1万
查看次数

iPad/iPhone - NSString drawInRect没有自动换行

我正在使用以下内容来渲染一些文本UIView.

- (void) drawRect:(CGRect)rect
{

    NSString* text = @"asdf asdf asdf asdf asdf asdf asdf";

    CGContextRef context = UIGraphicsGetCurrentContext();

    CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]);

    CGContextFillRect(context, rect);

    CGContextSetTextDrawingMode(context, kCGTextFillStrokeClip);

    CGContextSetFillColorWithColor(context, [[UIColor whiteColor] CGColor]);

    CGContextSetStrokeColorWithColor(context, [[UIColor blackColor] CGColor]);

    CGContextSetShouldSmoothFonts(context, YES);

    UIFont* font = [UIFont fontWithName:@"ArialRoundedMTBold" size:20.0f]; 

    CGSize textMaxSize = CGSizeMake(rect.size.width - 20.0f, rect.size.height);

    CGSize textSize = [text sizeWithFont:font constrainedToSize:textMaxSize lineBreakMode:UILineBreakModeWordWrap];

    CGRect textRect = CGRectMake(10.0f, 10.0f, textSize.width, textSize.height);

    [text drawInRect:textRect withFont:font];

    [text drawInRect:textRect withFont:font lineBreakMode:UILineBreakModeWordWrap]; 

    [text drawInRect:textRect withFont:font lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentCenter];
}
Run Code Online (Sandbox Code Playgroud)

没有 …

iphone nsstring ipad ios4

5
推荐指数
1
解决办法
5419
查看次数

标签 统计

ios4 ×1

ipad ×1

iphone ×1

nsstring ×1

video.js ×1