小编LE *_*ANG的帖子

UITextView在iOS 7中错误地呈现自定义字体

我的应用程序使用UITextView输入Syriac文本(Estrangelo字体),但是UITextView会像这样错误地呈现一些字母:

在此输入图像描述

我用UILabel和UITextView测试了它.UILabel正确显示它,但UITextView错误地显示顶部点并将它们移动到底部(参见上面的结果).

此问题仅发生在iOS 7中,并且不会发生在iOS 6中.请告诉我是否有任何方法可以解决问题.

这是我的测试代码

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];
label.center = CGPointMake(self.view.center.x, self.view.center.y-40);
label.font = [UIFont fontWithName:@"East Syriac Adiabene" size:24];
label.text = @"?? ?? ?? ??";
[self.view addSubview:label];

UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];
textView.center = CGPointMake(self.view.center.x, self.view.center.y+40);
textView.font = [UIFont fontWithName:@"East Syriac Adiabene" size:24];
textView.text = @"?? ?? ?? ??";
[self.view addSubview:textView];
Run Code Online (Sandbox Code Playgroud)

multilingual uitextview custom-font right-to-left ios7

48
推荐指数
1
解决办法
1876
查看次数

如何在分页启用时扩展UICollectionView contentSize?

UICollectionView启用分页机制我做的很简单,一切正常.但是,当滚动到最后一页时,屏幕中的单元格数量不完全可见,最后一页包含上一页面的一些单元格.

如何扩大contentSizeUICollectionView,这样最后一页不包含前一页的任何细胞?

这里的一个例子:UICollectionView水平滚动6个单元格,这样:

第1页: cell0 - cell1 - cell2 - cell3

滚动:cell2-cell3-cell4-cell5 //不期望:如何更改为:cell4 - 第2页中的单元格5.

摘要:

我想设置

collectionView.contentSize = numberOfPage * collectionView.frame

collectionView.contentSize = numberOfCell * (cellFrame + spacing)

uiscrollview ios uicollectionview

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

如何在iOS8自定义键盘中使用自动更正和快捷列表?

我想使用自定义和快捷列表,如我的自定义键盘默认英语键盘.我检查键盘文档,但不知道如何使用它.

键盘文档中.

每个自定义键盘(独立于其RequestsOpenAccess键的值)都可以通过UILexicon类访问基本的自动更正词典.利用此类以及您自己设计的词典,在用户输入文本时提供建议和自动更正.UILexicon对象包含来自各种来源的单词,包括:

  • 来自用户的地址簿数据库的不成对的名字和姓氏
  • "设置">"常规">"键盘">"快捷方式"列表中定义的文本快捷方式
  • 常用词典

如何在Objective-C中访问我们字典中的快捷列表和输入?

如何在requestSupplementaryLexiconWithCompletion中使用UILexicon?

keyboard objective-c ios ios8

18
推荐指数
2
解决办法
6459
查看次数

如何更改Android软键盘中任意键的关键背景

我希望键盘上的一些键与其他键不同.

例如,如下图中的shift,delete,space键:

在此输入图像描述

根据谷歌的参考文件.我们可以通过android:keybackground=@drawable/xxx在" input.xml"中使用" " 更改键的背景,但它会改变键盘中所有键的背景.

虽然qwerty.xml中的"android:keyicon"可以改变单个键,但它只替换标签.同时,使用" android:keyicon",图像无法覆盖整个按键,图像将比按键背景小一点.

更改某些键背景的正确方法是什么?

android background key android-softkeyboard

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

如何在UIBezierPath中填充颜色?

我在touchesMoved中通过UIBezierPath绘制一个形状.

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    secondPoint = firstPoint;
    firstPoint = [touch previousLocationInView:self];
    currentPoint = [touch locationInView:self];

    CGPoint mid1 = midPoint(firstPoint, secondPoint);
    CGPoint mid2 = midPoint(currentPoint, firstPoint);

    [bezierPath moveToPoint:mid1]; 
    [bezierPath addQuadCurveToPoint:mid2 controlPoint:firstPoint];

    [self setNeedsDisplay]; 
}
Run Code Online (Sandbox Code Playgroud)

我想在closePath之后填充其中的RED颜色但不能.请帮忙!

- (void)drawRect:(CGRect)rect
{
    UIColor *fillColor = [UIColor redColor];
    [fillColor setFill];
    UIColor *strokeColor = [UIColor blueColor];
    [strokeColor setStroke];
    [bezierPath closePath];
    [bezierPath fill];
    [bezierPath stroke]; 
}
Run Code Online (Sandbox Code Playgroud)

ios uibezierpath

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

在iOS8.1模拟器的Safari中看不到自定义键盘

更新到Xcode 6.1后,我在iOS8.1模拟器的Safari中丢失了自定义键盘.但它仍然出现在照片应用程序中.照片应用可以切换到我的自定义键盘,但Safari仍然显示英语和表情符号,其他系统键盘如阿拉伯语也无法正常工作.我重置模拟器,但没有工作.iOS8.1中的Safari看起来没什么变化.我试着清除DerivedData文件夹,但没有任何帮助.我删除Xcode并从Appstore重新安装,也不工作.

我必须在我的设备上测试,太奇怪了.有没有人有同样的问题?请帮忙解决这个问题.

ios ios8 custom-keyboard

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

如何通过jQueryUI,jQuery Mobile和iOS中的touchpunch使图像在contenteditable div中排序?

我试图通过jQueryUI,jQuery Mobile和touch punch插件在contenteditable ="true" div中的文本周围拖动图像

我想让图像可以像桌面上的http://jsfiddle.net/xFfYT/1/一样移动文本.图像可以按文本或其他标记移动.

 <div  id="firstpage" data-role="page" class="demo-page">
    <div data-role="content" contenteditable="true" id="sortable">
     <h1 id="sortable"> Make Images Sortable on iOS </h1>   
     <p id="sortable"> This is first picture 
        <img src="https://cdn3.iconfinder.com/data/icons/free-social-icons/67/facebook_square-512.png" />
         and second picture
         <img src="https://cdn1.iconfinder.com/data/icons/metro-ui-icon-set/128/Yahoo_alt_1.png" />
        drag to swap it into text position
     </p>
     <p id="sortable">
        second paragraph
     </p>
     <h2 id="sortable"> Sample need to test on iOS </h2>    

    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

在iOS上使用哪个jQuery Mobile,我使用这个触摸插件来使jQueryUI工作.但是图像只在标签之间移动(交换图像和其他p,h标签).

这个http://jsfiddle.net/RrZnx/1/是可以在iOS模拟器或设备上运行测试的代码.我在可排序的行之前复制触摸打码.

$( document ).on( "pageinit", "[data-role='page'].demo-page", function() { …
Run Code Online (Sandbox Code Playgroud)

javascript jquery jquery-ui jquery-mobile

9
推荐指数
1
解决办法
1467
查看次数

如何在iOS7中的UIPopoverController中禁用更暗的透明效果?

我使用UIPopoverController在iPad iOS7中弹出一个视图,如下所示:

    if (!self.popover) {
        UIViewController *popupVC = [[UIViewController alloc] init];
        [popupVC.view addSubview:thePopupView];
        popupVC.preferredContentSize = CGSizeMake(240, 140);
        self.popover = [[UIPopoverController alloc] initWithContentViewController:popupVC];
        self.popover.delegate = self;
    }


    [self.popover presentPopoverFromBarButtonItem:barButton permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
Run Code Online (Sandbox Code Playgroud)

但是当弹出窗口处于活动状态时,它会使屏幕变暗,而此效果不会影响iOS6中的其他视图.

如何克服这个问题?谢谢!

uipopovercontroller ios ios7

7
推荐指数
1
解决办法
6477
查看次数

无法在UIPopover的UINavigationController侧调整UIViewController的高度contentSizeForViewInPopover

我用UINavigationController里面UIPopoverController

-(void)showEditMenuFrom:(UIButton *)button{
    if (self.popover) {
        [self.popover dismissPopoverAnimated:YES];
        self.popover = nil;
    }
    else {
        EditMenuViewController *editMenuViewController = [[EditMenuViewController alloc] initWithNibName:@"EditMenuViewController" bundle:nil];

        UINavigationController *actionsNavigationController = [[UINavigationController alloc] initWithRootViewController:editMenuViewController];
        actionsNavigationController.delegate = self;

        // switch for iPhone and iPad.
        if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
            self.popover = [[UIPopoverController alloc] initWithContentViewController:actionsNavigationController];
            self.popover.delegate = self;
            //            CGRect presentFrame = CGRectMake(button.frame.origin.x-43, button.frame.origin.y-10, button.frame.size.width, button.frame.size.height);
            [self.popover presentPopoverFromRect:button.frame inView:button permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
        } else {
            [self presentViewController:actionsNavigationController animated:YES completion:^{
                NSLog(@"Activity complete");
            }];
        }
    }

    } …
Run Code Online (Sandbox Code Playgroud)

uinavigationcontroller ios uipopover

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

还有其他方法可以在拖动其他视图时检测视图吗?

我使用平移手势在拖动线中拖动多个视图,类似于:iOS - 拖放碰撞检测如何检测所选项目何时拖动到另一个子视图?

我的代码:

- (void)viewDidLoad
{
    [super viewDidLoad];
    for (UIView *aView in self.view.subviews) {
        [self addGestureRecognizersToPiece:aView];
    }
}

- (void)addGestureRecognizersToPiece:(UIView *)piece
{
    UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panPiece:)];
    [piece addGestureRecognizer:panGesture];
}



- (void)panPiece:(UIPanGestureRecognizer *)gestureRecognizer
{
    CGPoint dragingPoint = [gestureRecognizer locationInView:self.view];

    for (UIView *aView in self.view.subviews) {
        if (CGRectContainsPoint([aView frame], dragingPoint)) {
                aView.center = dragingPoint;
        }
    }

}
Run Code Online (Sandbox Code Playgroud)

我有这么多的子视图所以我不想在self.view中循环所有子视图,我只是想在拖动行中检测匹配视图.怎么做?

如果我使用[gestureRecognizer视图],我只会获得第一个视图.

提前感谢您的帮助!

uiview uigesturerecognizer ios

2
推荐指数
1
解决办法
3345
查看次数