난 그냥 안드로이드 개발을 시작하고 어떤 정보를 찾을 수없는 문제로 실행됩니다. 두 개의 창 템플릿을 사용하여 프로젝트를 만들었습니다. AdView
과 많은 다른 뷰를 2 개의 창 모드 (activity_setting_twopane.xml)에있는 동안 내 앱에 추가 할 수있었습니다. 어디 투쟁은 작은 디스플레이 (activity_setting_detail.xml, activity_setting_list.xml 또는 fragment_setting_detail.xml?)에 대한 다른 레이아웃에보기 (any)를 추가하는 방법입니다. 나는 이것이 올바른 방법하지만 지금 작동 유일한 아니라고 생각안드로이드에서 xml 조각보기 추가
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/setting_list"
android:name="com.test.firstapp.SettingListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
tools:context=".SettingListActivity"
tools:layout="@android:layout/list_content" >
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="xxxxxxxxxxxxxxxxx" >
</com.google.android.gms.ads.AdView>
</fragment>
fragment_setting_detail.xml하는 뷰 (AN AdView
)를 추가 할 수 있었다. 하지만 AdView
은 화면 상단에 표시되며, 대부분의 매개 변수를 사용할 수 없으므로 Fragments
에 위치하기 때문에 배치 방법을 모릅니다. 심지어는 LinearLayout
에 포장하려고했지만 코드에서 레이아웃에 뷰를 추가하려는 샘플 프로젝트가 충돌합니다. 어떤 견해를 추가 할 올바른 방법은 Fragments
(샘플을 사용하여 이해하기 때문에)을 기반으로합니까? 사전
중력을 'Android : layout_gravity : bottom'처럼'AdView'에 설정하려고 했습니까? – Fllo
네, 전에 안드로이드를 추가하여 시도 : layout_gravity = "하단"하지만 그것도 작동하지 않습니다. 그것은 맨 위에 있습니다. – Digit
'weightSum'을 가진'layout_weight'를 부모에게 추가하려고합니다. 또는 'RelativeLayout'방식으로 시도해보십시오. 아래에서 내 업데이트 대답을 참조하십시오. – Fllo