TADNativeMediaView

@objcMembers
public class TADNativeMediaView : UIView

Native 廣告需要顯示 media 內容(圖片或影片) 的 view 需代入 TADNativeAdMediaContent 才能正確顯示內容

  • 原生廣告的 media 物件, 其中包含圖片和影片

    Declaration

    Swift

    public var mediaContent: TADNativeAdMediaContent? { get set }
  • native 廣告顯示影片時, 實作此 Delegate 可取得影片的狀態回報

    Declaration

    Swift

    public weak var statusDelegate: TADVideoStatusDelegate? { get set }
  • 初始化物件

    Declaration

    Swift

    public override init(frame: CGRect)
  • 初始化物件

    Declaration

    Swift

    public required init?(coder: NSCoder)
  • 使用 UIImage 設定 main image

    Declaration

    Swift

    public func setMainImage(image: UIImage?)

    Parameters

    image

    UIImage物件

  • 使用 URL string 設定 main image

    Declaration

    Swift

    public func setMainImage(with urlString: String?)

    Parameters

    urlString

    載入的連結字串

  • 設定 main image 的圖片顯示方式

    Declaration

    Swift

    public func setMainImage(contentMode: UIView.ContentMode)

    Parameters

    contentMode

    帶入顯示類型。參照UIView.ContentMode

  • 設定外開網頁按鈕是否顯示,預設為顯示

    Declaration

    Swift

    public func setCallToActionVisible(_ isVisible: Bool)

    Parameters

    isVisible

    顯示/不顯示

  • 自定義外開網頁文字大小,預設為12.0

    Declaration

    Swift

    public func setCallToActionTextSize(_ textSize: CGFloat)

    Parameters

    textSize

    文字大小

  • 自定義影音倒數文字大小,預設為17.0

    Declaration

    Swift

    public func setVideoCountdownTextSize(_ textSize: CGFloat)

    Parameters

    textSize

    文字大小

  • 自定義靜音按鈕圖片大小,預設為24

    Declaration

    Swift

    public func setVolumeImageSize(_ imageSize: Int)

    Parameters

    imageSize

    圖片大小