Comment on page
Creating Native AdView
- 1.open xcode with your current Flutter Ios project.
- 2.Add Empty .xib file to Runner.
- 3.Name it NativeAdView
- 4.Open that file as source code.
- 5.Add Below code into it.
NativeAdView.xib
1
<?xml version="1.0" encoding="UTF-8"?>
2
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
3
<device id="retina4_7" orientation="portrait" appearance="light"/>
4
<dependencies>
5
<deployment version="2048" identifier="iOS"/>
6
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
7
<capability name="System colors in document resources" minToolsVersion="11.0"/>
8
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9
</dependencies>
10
<objects>
11
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
12
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
13
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="GADNativeAdView">
14
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
15
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
16
<subviews>
17
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="iNa-bH-h1m">
18
<rect key="frame" x="15" y="15.5" width="40" height="40"/>
19
<constraints>
20
<constraint firstAttribute="height" constant="40" id="ICz-3W-FQf"/>
21
<constraint firstAttribute="width" constant="40" id="vY6-8D-xIn"/>
22
</constraints>
23
</imageView>
24
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Advertiser" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GTT-Yh-eSq">
25
<rect key="frame" x="63" y="38.5" width="66.5" height="17"/>
26
<fontDescription key="fontDescription" type="system" pointSize="14"/>
27
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
28
<nil key="highlightedColor"/>
29
</label>
30
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="100" placeholderIntrinsicHeight="17" translatesAutoresizingMaskIntoConstraints="NO" id="2Of-AP-0h9">
31
<rect key="frame" x="129.5" y="38.5" width="100" height="17"/>
32
<constraints>
33
<constraint firstAttribute="height" constant="17" id="jBW-Cz-Kyc"/>
34
<constraint firstAttribute="width" constant="100" id="sXk-zk-NI0"/>
35
</constraints>
36
</imageView>
37
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="Body that is really really long and can take up to two lines or sometimes even more." textAlignment="justified" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PEQ-D9-2Vv">
38
<rect key="frame" x="15" y="63.5" width="536" height="33.5"/>
39
<fontDescription key="fontDescription" type="system" pointSize="14"/>
40
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
41
<color key="highlightedColor" systemColor="labelColor"/>
42
</label>
43
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="E5w-YA-UY8">
44
<rect key="frame" x="504" y="259.5" width="47" height="34"/>
45
<fontDescription key="fontDescription" type="system" pointSize="18"/>
46
<state key="normal" title="Install">
47
<color key="titleColor" systemColor="systemYellowColor"/>
48
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
49
</state>
50
</button>
51
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Price" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ysb-of-cat">
52
<rect key="frame" x="416" y="268" width="33" height="17"/>
53
<fontDescription key="fontDescription" type="system" pointSize="14"/>
54
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
55
<nil key="highlightedColor"/>
56
</label>
57
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Store" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hwF-UL-Q8H">
58
<rect key="frame" x="459" y="268" width="35" height="17"/>
59
<fontDescription key="fontDescription" type="system" pointSize="14"/>
60
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
61
<nil key="highlightedColor"/>
62
</label>
63
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="Headline" textAlignment="justified" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="beR-eV-DX1">
64
<rect key="frame" x="63" y="10" width="483" height="20.5"/>
65
<constraints>
66
<constraint firstAttribute="height" constant="20.5" id="6r8-Hu-d0y"/>
67
</constraints>
68
<fontDescription key="fontDescription" type="system" pointSize="17"/>
69
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
70
<nil key="highlightedColor"/>
71
</label>
72
<view contentMode="scaleToFill" id="fNp-yu-K4i" customClass="GADMediaView">
73
<rect key="frame" x="37" y="102" width="300" height="150"/>
74
<autoresizingMask key="autoresizingMask"/>
75
<constraints>
76
<constraint firstAttribute="height" priority="750" constant="150" id="71m-kn-7Ug"/>
77
<constraint firstAttribute="width" constant="250" id="e3T-fD-di4"/>
78
</constraints>
79
</view>
80
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Ad" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lp1-oz-XOs">
81
<rect key="frame" x="0.0" y="0.0" width="15" height="15"/>
82
<color key="backgroundColor" red="1" green="0.80000001190000003" blue="0.40000000600000002" alpha="1" colorSpace="calibratedRGB"/>
83
<constraints>
84
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="15" id="Twa-Vk-uWQ"/>
85
<constraint firstAttribute="height" constant="15" id="k8m-kJ-CF5"/>
86
</constraints>
87
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="11"/>
88
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
89
<nil key="highlightedColor"/>
90
</label>
91
</subviews>
92
<color key="backgroundColor" white="0.15291942848640233" alpha="1" colorSpace="calibratedWhite"/>
93
<constraints>
94
<constraint firstItem="GTT-Yh-eSq" firstAttribute="leading" secondItem="beR-eV-DX1" secondAttribute="leading" id="0sB-Mk-EU6"/>
95
<constraint firstItem="lp1-oz-XOs" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="3lA-qv-Nkc"/>
96
<constraint firstItem="Ysb-of-cat" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="3pc-w6-uy1"/>
97
<constraint firstItem="PEQ-D9-2Vv" firstAttribute="top" relation="greaterThanOrEqual" secondItem="iNa-bH-h1m" secondAttribute="bottom" id="4S3-p0-z6A"/>
98
<constraint firstAttribute="trailing" secondItem="PEQ-D9-2Vv" secondAttribute="trailing" constant="10" id="8U0-Fb-3R7"/>
99
<constraint firstItem="iNa-bH-h1m" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="15" id="9WK-zC-xET"/>
100
<constraint firstAttribute="trailing" secondItem="beR-eV-DX1" secondAttribute="trailing" constant="15" id="BcE-do-dNl"/>
101
<constraint firstItem="lp1-oz-XOs" firstAttribute="left" secondItem="iN0-l3-epB" secondAttribute="left" id="BpX-yC-PZG"/>
102
<constraint firstItem="PEQ-D9-2Vv" firstAttribute="top" secondItem="2Of-AP-0h9" secondAttribute="bottom" constant="8" symbolic="YES" id="CCg-xe-cKg"/>
103
<constraint firstItem="2Of-AP-0h9" firstAttribute="top" secondItem="beR-eV-DX1" secondAttribute="bottom" constant="8" symbolic="YES" id="ESC-Pe-TXR"/>
104
<constraint firstItem="iNa-bH-h1m" firstAttribute="bottom" secondItem="2Of-AP-0h9" secondAttribute="bottom" id="GwM-y0-1du"/>
105
<constraint firstItem="beR-eV-DX1" firstAttribute="leading" secondItem="iNa-bH-h1m" secondAttribute="trailing" constant="8" symbolic="YES" id="MRN-dd-Oip"/>
106
<constraint firstItem="2Of-AP-0h9" firstAttribute="leading" secondItem="GTT-Yh-eSq" secondAttribute="trailing" id="Med-Nd-wEo"/>
107
<constraint firstItem="beR-eV-DX1" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="Mvs-eV-Wzb"/>
108
<constraint firstItem="Ysb-of-cat" firstAttribute="centerY" secondItem="hwF-UL-Q8H" secondAttribute="centerY" id="Rud-i8-Myz"/>
109
<constraint firstItem="fNp-yu-K4i" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="TYN-lq-3DK"/>
110
<constraint firstItem="fNp-yu-K4i" firstAttribute="top" secondItem="PEQ-D9-2Vv" secondAttribute="bottom" constant="5" id="V0m-hf-6NS"/>
111
<constraint firstItem="GTT-Yh-eSq" firstAttribute="centerY" secondItem="2Of-AP-0h9" secondAttribute="centerY" id="YgR-kp-age"/>
112
<constraint firstItem="hwF-UL-Q8H" firstAttribute="leading" secondItem="Ysb-of-cat" secondAttribute="trailing" constant="10" id="aLb-sm-wAb"/>
113
<constraint firstAttribute="right" relation="greaterThanOrEqual" secondItem="lp1-oz-XOs" secondAttribute="right" constant="20" symbolic="YES" id="czi-qD-IaJ"/>
114
<constraint firstAttribute="trailing" secondItem="E5w-YA-UY8" secondAttribute="trailing" constant="10" id="eNM-dN-tvx"/>
115
<constraint firstItem="E5w-YA-UY8" firstAttribute="leading" secondItem="hwF-UL-Q8H" secondAttribute="trailing" constant="10" id="f39-vH-KWq"/>
116
<constraint firstItem="iNa-bH-h1m" firstAttribute="leading" secondItem="PEQ-D9-2Vv" secondAttribute="leading" id="mof-5F-8vM"/>
117
<constraint firstItem="E5w-YA-UY8" firstAttribute="centerY" secondItem="hwF-UL-Q8H" secondAttribute="centerY" id="rNj-VY-YrO"/>
118
<constraint firstItem="E5w-YA-UY8" firstAttribute="top" secondItem="fNp-yu-K4i" secondAttribute="bottom" constant="7.5" id="rup-e7-1CR"/>
119
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="E5w-YA-UY8" secondAttribute="bottom" constant="20" symbolic="YES" id="uEI-XT-igi"/>
120
</constraints>
121
<connections>
122
<outlet property="advertiserView" destination="GTT-Yh-eSq" id="bY8-5O-6fF"/>
123
<outlet property="bodyView" destination="PEQ-D9-2Vv" id="Gpd-Q6-Byv"/>
124
<outlet property="callToActionView" destination="E5w-YA-UY8" id="RCf-yK-s1x"/>
125
<outlet property="headlineView" destination="beR-eV-DX1" id="d1E-ed-yel"/>
126
<outlet property="iconView" destination="iNa-bH-h1m" id="gIe-xy-iwm"/>
127
<outlet property="mediaView" destination="fNp-yu-K4i" id="624-ZP-L04"/>
128
<outlet property="priceView" destination="Ysb-of-cat" id="L6Q-hd-uaJ"/>
129
<outlet property="starRatingView" destination="2Of-AP-0h9" id="zCO-9D-S0V"/>
130
<outlet property="storeView" destination="hwF-UL-Q8H" id="hRl-23-ce1"/>
131
</connections>
132
<point key="canvasLocation" x="13.768115942028986" y="-5.6919642857142856"/>
133
</view>
134
</objects>
135
<resources>
136
<systemColor name="labelColor">
137
<color red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
138
</systemColor>
139
<systemColor name="systemYellowColor">
140
<color red="1" green="0.80000000000000004" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
141
</systemColor>
142
</resources>
143
</document>