下面是我在<div class="inputFields">
<label for="headline">Headline or Title</label><br>
<input type="text" id="headline" placeholder="Enter your title here"><br>
<label for="articleContent">Enter your content here</label><br>
<textarea id="articleContent" placeholder="Once upon a time....."></textarea>
<button id="submitArticleButton">Submit!</button>
</div>
<div id="newArticle">
<h1 id="userArticleHeader"></h1>
<p id="userArticleContent"></p>
<button id="editPost">Edit</button>
</div>
动态膨胀的xml。但是,当我这样做时,
Fragment
NativeAppInstallAdView add = (NativeAppInstallAdView) contentView.findViewById(R.id.adView);
引用在其他视图(如
add
工作正常。我无法确切地知道它为什么会发生在这里。任何帮助都会很棒。
ImageView imgLogo = (ImageView) contentView.findViewById(R.id.ivLogo);