小编ser*_*dar的帖子

HTML5音频行为

我在HTML5页面中有一个音频元素.我开始播放音频然后暂停.之后我按回家按钮返回主屏幕并拨打电话.当呼叫结束时,音频元素自动恢复.这发生在Android 4.0.3上

问题是,这不是预期和期望的行为.不幸的是,当浏览器在后台运行时,不会抛出javascript事件,我无法使用Javascript捕获并阻止此行为.

任何帮助表示赞赏.提前致谢.

javascript html5 android webkit html5-audio

23
推荐指数
1
解决办法
2462
查看次数

UITextField inputView未在iPhone 6中显示

我有一个奇怪的错误,只发生在Xcode 6的iPhone 6模拟器中.我有一个通用组件,它扩展了UITextField并在屏幕底部显示了一个pickerView作为inputView.

如果我使用iPhone5或iPhone5s来测试我的应用程序,它正在按预期工作:inputView和inputAccessoryView正确显示.但是如果我切换到iPhone 6或Plus模拟器,屏幕底部只显示inputAccessoryView,则不显示inputView.

这是我的代码:

@interface DropDownTextField : UITextField

@property (strong,nonatomic) UIPickerView* pickerView;
@property (strong,nonatomic) UIToolbar *toolBar;
@property CGFloat originalFontSize;

@property (nonatomic) id<UIPickerViewDelegate> pickerDelegate;
@property (nonatomic) id<UIPickerViewDataSource> pickerDataSource;

- (CGFloat)requiredFontSize;
- (void)setDropdownMode:(BOOL)enabled;

@end

@implementation DropDownTextField

-(id)initWithCoder:(NSCoder *)aDecoder {
    if(self = [super initWithCoder:aDecoder]) {
        self.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
        self.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;

        [self setFont:[UIFont mediumRegular]];
        _originalFontSize = self.font.pointSize;

        self.layer.borderWidth = 1.0f;

        CGRect frame = [self frame];

        // rightview dropdown arrow
        UIImageView *dropDownImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, (frame.size.height-8)/2, 14.0f, 8.0f)];
        UIImage *dropDownImage = …
Run Code Online (Sandbox Code Playgroud)

objective-c uitextfield ios inputview xcode6

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