0

我已经启用了 UItextview 的 set editable property yes 并且我能够在模拟器中运行时复制文本。但我无法在 iPhone 设备中复制粘贴文本..请有人解决我的问题

4

2 回答 2

0

您能否通过双击 UITextView 进行复制和粘贴来尝试一次。还要检查此链接在 UITextField 上启用复制和粘贴而不使其可编辑 希望这可以帮助您。

于 2013-04-19T05:03:19.930 回答
0

您是否尝试过使用“粘贴”方法?这是 iOS 指南中的一个示例:http: //developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/UsingCopy,Cut,andPasteOperations/UsingCopy,Cut,andPasteOperations.html

- (void)paste:(id)sender {
    UIPasteboard *gpBoard = [UIPasteboard generalPasteboard];
    NSArray *pbType = [NSArray arrayWithObject:ColorTileUTI];
    ColorTile *theTile = [self colorTileForOrigin:currentSelection];
    if (theTile == nil && [gpBoard containsPasteboardTypes:pbType]) {
        NSData *tileData = [gpBoard dataForPasteboardType:ColorTileUTI];
        ColorTile *theTile = (ColorTile *)[NSKeyedUnarchiver     unarchiveObjectWithData:tileData];
        if (theTile) {
            theTile.tileOrigin = self.currentSelection;
            [tiles addObject:theTile];
            CGRect tileRect = [self rectFromOrigin:currentSelection inset:TILE_INSET];
            [self setNeedsDisplayInRect:tileRect];
        }
    }
}
于 2013-04-19T09:09:37.757 回答