我的应用程序使用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) UICollectionView
启用分页机制我做的很简单,一切正常.但是,当滚动到最后一页时,屏幕中的单元格数量不完全可见,最后一页包含上一页面的一些单元格.
如何扩大contentSize
的UICollectionView
,这样最后一页不包含前一页的任何细胞?
这里的一个例子:UICollectionView
水平滚动6个单元格,这样:
第1页: cell0 - cell1 - cell2 - cell3
滚动:cell2-cell3-cell4-cell5 //不期望:如何更改为:cell4 - 第2页中的单元格5.
摘要:
我想设置
collectionView.contentSize = numberOfPage * collectionView.frame
不
collectionView.contentSize = numberOfCell * (cellFrame + spacing)
我想使用自定义和快捷列表,如我的自定义键盘默认英语键盘.我检查键盘文档,但不知道如何使用它.
在键盘文档中.
每个自定义键盘(独立于其RequestsOpenAccess键的值)都可以通过UILexicon类访问基本的自动更正词典.利用此类以及您自己设计的词典,在用户输入文本时提供建议和自动更正.UILexicon对象包含来自各种来源的单词,包括:
如何在Objective-C中访问我们字典中的快捷列表和输入?
如何在requestSupplementaryLexiconWithCompletion中使用UILexicon?
我希望键盘上的一些键与其他键不同.
例如,如下图中的shift,delete,space键:
根据谷歌的参考文件.我们可以通过android:keybackground=@drawable/xxx
在" input.xml
"中使用" " 更改键的背景,但它会改变键盘中所有键的背景.
虽然qwerty.xml中的"android:keyicon"可以改变单个键,但它只替换标签.同时,使用" android:keyicon
",图像无法覆盖整个按键,图像将比按键背景小一点.
更改某些键背景的正确方法是什么?
我在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) 更新到Xcode 6.1后,我在iOS8.1模拟器的Safari中丢失了自定义键盘.但它仍然出现在照片应用程序中.照片应用可以切换到我的自定义键盘,但Safari仍然显示英语和表情符号,其他系统键盘如阿拉伯语也无法正常工作.我重置模拟器,但没有工作.iOS8.1中的Safari看起来没什么变化.我试着清除DerivedData文件夹,但没有任何帮助.我删除Xcode并从Appstore重新安装,也不工作.
我必须在我的设备上测试,太奇怪了.有没有人有同样的问题?请帮忙解决这个问题.
我试图通过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) 我使用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中的其他视图.
如何克服这个问题?谢谢!
我用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) 我使用平移手势在拖动线中拖动多个视图,类似于: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视图],我只会获得第一个视图.
提前感谢您的帮助!
ios ×7
ios7 ×2
ios8 ×2
android ×1
background ×1
custom-font ×1
javascript ×1
jquery ×1
jquery-ui ×1
key ×1
keyboard ×1
multilingual ×1
objective-c ×1
uibezierpath ×1
uipopover ×1
uiscrollview ×1
uitextview ×1
uiview ×1