2013-02-10 3 views
0

내 레이아웃에 레이아웃에 EditText으로 표시되는 admob 광고가 있습니다. 나는 키보드가 나타납니다 뭔가를 입력 할 텍스트를 편집에 초점을 맞추고 글고 치기를 통해 AdMob 광고를 이동하고 당신은 당신이 입력하는 것을 볼 수 없습니다합니다.키보드가 표시 될 때 레이아웃이 조정됩니다.

이 내 매니페스트 내가 내 레이아웃

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:isScrollContainer="false" > 

<ScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/wood_floor" > 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" > 

     <com.tyczj.bowling.adapters.RobotoThinTextView 
      android:id="@+id/textView2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="40dp" 
      android:layout_marginTop="30dp" 
      android:text="Add Bowler" 
      android:textAppearance="?android:attr/textAppearanceLarge" 
      android:textColor="#33b5e5" 
      android:textSize="40dp" /> 

     <FrameLayout 
      android:id="@+id/line" 
      android:layout_width="fill_parent" 
      android:layout_height="2dp" 
      android:layout_alignParentLeft="true" 
      android:layout_below="@+id/textView2" 
      android:layout_marginLeft="20dp" 
      android:layout_marginRight="20dp" 
      android:layout_marginTop="8dp" 
      android:background="@drawable/ab_solid_custom_blue_inverse_holo" > 
     </FrameLayout> 

     <com.tyczj.bowling.adapters.RobotoThinTextView 
      android:id="@+id/textView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/line" 
      android:layout_below="@+id/line" 
      android:layout_marginTop="20dp" 
      android:text="@string/bNameTV" 
      android:textAppearance="?android:attr/textAppearanceMedium" /> 

     <EditText 
      android:id="@+id/editText1" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignBottom="@+id/textView1" 
      android:layout_below="@+id/line" 
      android:layout_marginLeft="30dp" 
      android:layout_marginRight="20dp" 
      android:layout_toRightOf="@+id/textView1" 
      android:inputType="textCapSentences" > 

      <requestFocus /> 
     </EditText> 

     <EditText 
      android:id="@+id/editText2" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignBottom="@+id/textView3" 
      android:layout_below="@+id/editText1" 
      android:layout_marginLeft="30dp" 
      android:layout_marginRight="20dp" 
      android:layout_toRightOf="@+id/textView3" 
      android:inputType="textCapSentences" > 

      <requestFocus /> 
     </EditText> 

     <com.tyczj.bowling.adapters.RobotoThinTextView 
      android:id="@+id/textView3" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/line" 
      android:layout_below="@+id/textView1" 
      android:layout_marginTop="20dp" 
      android:text="@string/lNameTV" 
      android:textAppearance="?android:attr/textAppearanceMedium" /> 

     <RadioButton 
      android:id="@+id/radioButton1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/textView3" 
      android:layout_below="@+id/textView3" 
      android:layout_marginTop="15dp" 
      android:checked="true" 
      android:text="Right Handed" /> 

     <RadioButton 
      android:id="@+id/radioButton2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/line" 
      android:layout_below="@+id/radioButton1" 
      android:text="Left Handed" /> 

     <Button 
      android:id="@+id/done" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/line" 
      android:layout_alignParentBottom="true" 
      android:layout_below="@+id/radioButton2" 
      android:onClick="onDoneClick" 
      android:text="@string/done" /> 
    </RelativeLayout> 
</ScrollView> 

<com.google.ads.AdView 
    android:id="@+id/ad" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    ads:adSize="IAB_BANNER" 
    ads:loadAdOnCreate="true" /> 

</RelativeLayout> 

입니다 활동에 android:windowSoftInputMode="stateVisible|adjustResize"을 설정 했는데도 아무런 영향이 없었습니다.

키보드가 나타나면 광고가 움직이지 않게하려면 어떻게합니까?

답변

0

adjustPan 모드를 사용해 보셨습니까? 그것은 당신을 위해 더 잘 작동 할 수 있습니다. 요소의 화면 아래쪽에 정렬 된 RelativeLayout이 있으므로 adjustResize는 항상 해당 요소를 화면 하단에 유지합니다. 하단에 정렬하는 대신 스크롤보기 아래에 광고를 놓아서 레이아웃을 수정하여 문제를 해결할 수 있습니다.

+0

이 광고는 이동하지 않습니다하지만있는 ScrollView 스크롤하지 않으며 것 키보드가 나타나면 다른 레이아웃 요소로 이동할 수 없습니다. – tyczj

0

대신 최 RelativeLayoutLinearLayout를 사용하여 시도하고 android:layout_weight="1"ScrollView 및 추가 AdViewandroid:layout_weight="0"로 : 나는 그런에 추가하는 경우

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical"> 

    <ScrollView 
    android:layout_width="fill_parent" 
    android:layout_height="0" 
    android:layout_weight="1" 
    ... 
    /> 
    ... 
    </ScrollView> 

    <com.google.ads.AdView 
    android:layout_width="fill_parent" 
    android:layout_height="0" 
    android:layout_weight="0" 
    .../> 

</LinearLayout> 
관련 문제