选择像ibook这样的核心文本中的文本 [英] Selection of text in core text like ibook

查看:104
本文介绍了选择像ibook这样的核心文本中的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个圣经应用程序,它使用核心文本在视图中显示经文... txt来自本地存储的sqlite db ,,,我使用这个核心文本包装器来渲染我的文本,,,因为它支持多列视图,核心文本warpper ,,,但我需要选择诗歌功能...如果如果我有这节经文,用户可以点击选择特定经文所需的经文1上帝创造了隆起和地球。 2等等,,,。 3等等,,,,。当用户点击第一节经文时,需要选择该经文并突出显示该经文.....如eBible app或ibook app ...

i done a bible application which uses core text for showing verses in a view...the txt came from locally stored sqlite db,,,i am using this core text wrapper for rendering my text,,,becz it support multi column view ,,core text warpper,,,but i need the selection of verse functionality...if the user tap the verse it need to select that particular verse,,if i have this verse 1 The God create Heave and earth . 2 etc etc,,, . 3 etc etc,,,, . when the user tap the first verse it need to select that verse and highlight that verse.....like the eBible app or ibook app...

有没有示例在核心文本中显示此类功能..Plz给我一个可能有用的链接。
Thabnks in advcance。

Is there any example to show this kind of functionality in core text..Plz give me a link which might be helpful . Thabnks in advcance.

推荐答案

我在我的圣经应用程序中做了类似的事情(https://github.com/ photokandyStudios / gbible)。特别是,请参阅 https://github.com/photokandyStudios/gbible /blob/master/gbible/PKBibleViewController.m#L1301

I do something similar in my Bible app (https://github.com/photokandyStudios/gbible). In particular, see https://github.com/photokandyStudios/gbible/blob/master/gbible/PKBibleViewController.m#L1301

基本上我维护一个选择数组,当用户点击这节经文时(在我的情况下是uitableviewcell),我将它添加到数组中。我还为单元格的背景着色以反映选择。

Essentially I maintain a selection array, and when a user taps the verse (in my case a uitableviewcell), I add it to the array. I also color the background of the cell to reflect the selection.

使用放大镜不是完美的选择,但就我的目的而言,还不错。

It isn't word-perfect selection with the loupe, but for my purposes, good enough.

这篇关于选择像ibook这样的核心文本中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆