問題描述
這可能是一個愚蠢的問題.我正在嘗試像附圖一樣設置左/右頁邊距.我通過將 UITextView 添加到 UIScrollView 成功實現了它.但是,僅使用 UITextView 幾乎可以實現我想要的一切.比如UIScrollView,當我手動修改UITextView的文字時,不管它的.scrollEnabled是否設置為No,它都會自動滾動到底部.
It might be a silly question. I'm trying to set left/right margins like the attached picture. I succeeded to implement it by adding UITextView to UIScrollView. However, I could achieve almost everything I want with UITextView alone. For example, with UIScrollView, when I manually change the text of UITextView, it automatically scrolls to bottom regardless of setting its .scrollEnabled to No.
如果 UITextView 的滾動指示器出現在 UITextView 之外就完美了.在附圖中,假設紅色框代表整個 UITextView.我嘗試更改 UITextView 的 scrollIndicatorInsets 屬性,但滾動指示器只能向內移動才能看到.
It would be perfect if a scroll indicator of UITextView appears outside UITextView. In the attached picture, let's say the red box represents the entire UITextView. I tried to change UITextView's scrollIndicatorInsets property, but a scroll indicator can be moved only inward to be visible.
Pages、aWriter、Plaintext 等多個應用實現了此功能.可以給點建議嗎?
Several apps such as Pages, aWriter, Plaintext achieve this feature. Could you give any suggestion?
謝謝!
我
推薦答案
您可以將 UITextView 的滾動條右插入值設置為負值并禁用剪輯子視圖選項以實現您的要求.不需要其他滾動視圖.
You can set the scroller right inset value of the UITextView to negative value and disable the clip subview option to achieve your require. No other scrollview is needed.
這篇關于有沒有辦法將 UITextView 的滾動指示器放到 UITextView 之外?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!