0
爲了適應所有的佈局AdMob廣告出現時,我想獲得它的高度都沒有成功,高度始終= 0!如何達到它?謝謝。Android開AdMob的高度
/** Called when an ad is received. */
@Override
public void onReceiveAd(Ad ad)
{
adView.setVisibility(View.VISIBLE);
final android.view.ViewTreeObserver obs = adView.getViewTreeObserver();
obs.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
int height = adView.getHeight();
return true;
}
});
類已經實現了AdListener的和事件妥善解僱任何問題!但是,adView.height = 0! – Jaume