簡體   English   中英

iOS Swift PDFKit小部件子類型按鈕邊框

[英]iOS Swift PDFKit Widget Subtype button border

我正在使用PDFKit,並且希望添加一個支持用戶選擇/取消選擇它的PDF注釋。 我正在使用PDFAnnotationWidgetSubtype.button ,但找不到刪除邊框的方法。 我嘗試將PDFBorder子類無濟於事,還有其他人對此有經驗嗎?

帶有邊框的復選框

回答

解決此問題的方法是創建自己的PDFAnnotation子類。

var isChecked = false

init(forBounds bounds: CGRect, withProperties properties: [AnyHashable : Any]?)

override func draw(with box: PDFDisplayBox, in context: CGContext)

我在draw函數中使用了isChecked屬性。 如果啟用了該屬性,那么將顯示在Icons8上找到的對勾圖像。 我還必須在ViewController中添加PDFAnnotationHitObserver,並處理了isChecked屬性的更新。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM