我正在嘗試構建一本書閱讀器。而現在我有一個很長的文本,填滿了整個屏幕,甚至一些文本沒有了屏幕。我想知道如何找到在屏幕上完全可見的最後一個字母,這樣我就可以將文本分成頁面。Android:如何確定TextView中最後一個完全可見的字母?
例如,所有的行之前
「壞消息,弗農,」她說......
完全可見的文本,其餘文本必須移動到另一頁。
這樣的(另一個文本頁面與 「壞消息」 開始)
這裏是我以前在例如
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="...some text..." />
</RelativeLayout>
你正在努力實現頁面夾板 請檢查了這一點 https://stackoverflow.com/questions/20204348/how-to-break-styled-text-into-pages-in-android – argando
我曾嘗試示例應用程序從argando的鏈接提供,它似乎工作爲我想要 – Season