在android使用了一个AdMob使图,没有高宽设置,等到显示的时候就溢出。有没有什么方法能得到这个通知?我好能调整布局尺寸。
要重写onLayout
的,
View view = new View(this) {
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
}
};
试试这个:
AdView.setAdListener(new AdListener() {
public void onRecieveAd(){
//调整视图尺寸
}
});
如果想知道adview什么时候接收广告,可以用onFailedToRecieveAd
监听器:
AdView.setAdListener(new AdListener() {
public void onFailedToRecieveAd(){
//……接下来自己加
}
});