2013-04-06 130 views
0

我开发了一个应用程序(即当前在玩谷歌),并把广告出错。Android中的广告问题

我把截图给你一个想法。

1º启动应用程序和广告是正常的,当在EditText(文本)上按下是正常的,通常会停止写入。

1º--- http://i.stack.imgur.com/7VTgL.png

问题是,当我切换活动或广告再次访问,并击中了一样的EditText(文本)被封锁的广告,因为这并EditText上停留在现场。 ! [广告现在上升,而不是eddittext] [3]

http://i.stack.imgur.com/j35Nw.png

这里我XML活动:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".MainActivity" > 

    <ImageView 
     android:id="@+id/Biniciar" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/Etitulo" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="36dp" 
     android:src="@drawable/micro" /> 

    <TextView 
     android:id="@+id/textView2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignBaseline="@+id/ETexto" 
     android:layout_alignBottom="@+id/ETexto" 
     android:layout_alignRight="@+id/textView1" 
     android:text="@string/Texto" 
     android:textAppearance="?android:attr/textAppearanceLarge" /> 

    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:id="@+id/anuncio" 
     android:layout_width="match_parent" 
     android:layout_height="60dp" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:background="#FFFFFF" > 
    </LinearLayout> 

    <TextView 
     android:id="@+id/textView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignBottom="@+id/Etitulo" 
     android:text="@string/Titulo" 
     android:textAppearance="?android:attr/textAppearanceLarge" /> 

    <Button 
     android:id="@+id/Bborrar" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentTop="true" 
     android:text="@string/Limpiar" /> 

    <Button 
     android:id="@+id/BAdmin" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentTop="true" 
     android:text="@string/Notas" /> 

    <EditText 
     android:id="@+id/Etitulo" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/Bborrar" 
     android:layout_marginTop="21dp" 
     android:layout_toRightOf="@+id/textView1" 
     android:ems="10" 
     android:inputType="text" > 

     <requestFocus /> 
    </EditText> 

    <Button 
     android:id="@+id/BGuardar" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_centerHorizontal="true" 
     android:text="@string/Guardar" /> 

    <EditText 
     android:id="@+id/ETexto" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignLeft="@+id/Etitulo" 
     android:layout_below="@+id/Biniciar" 
     android:layout_marginTop="31dp" 
     android:ems="10" 
     android:inputType="textMultiLine" 
     android:maxLines="5" /> 

</RelativeLayout> 
+0

你需要管理你的xml文件设计 – 2013-04-06 11:47:33

+0

你可以在这里放置你的xml文件 – 2013-04-06 11:47:48

+0

当然,现在你可以看到我的XML,广告是线性布局“anuncio”。 Thx – CristianCV 2013-04-06 13:36:19

回答

0

你原来的布局没有键盘恰好与广告,因为剩下的工作您的内容不会填满整个页面。最好的做法是,除了将广告对齐到底部外,还要告诉其余的布局放在广告的旁边。

<RelativeLayout> 
    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:id="@+id/anuncio" 
     android:layout_width="match_parent" 
     android:layout_height="60dp" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:background="#FFFFFF" > 
    </LinearLayout> 
    <RelativeLayout 
     android:id="@+id/restOfMyLayout" 
     android:layout_above="@id/anuncio"> 
     // Put the rest of your layout here. 
    </RelativeLayout> 
</RelativeLayout> 

如果您这样做,广告将不会覆盖您的文本框。

+0

Thx,现在我有不同的布局,但现在看起来像这样,当我去做另一项活动并回来。现在一切都上升http://imgur.com/9IVkD9W – CristianCV 2013-04-07 10:37:05