안드로이드 개발 질문/답변
(글 수 45,052)
이렇게 광고가 릴렉티브 레이아웃에 의해 하단에 들어가게되는데요,
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bk_game"
android:orientation="vertical"
tools:context=".Activity" >
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bk_game"
android:orientation="vertical"
tools:context=".Activity" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/TextViewTest"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:gravity="center"
android:textColor="#613636"
android:textSize="@dimen/threezero"
android:textStyle="bold" >
</TextView>
<ImageView
android:id="@+id/ImageView1"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="2"
android:adjustViewBounds="true" >
</ImageView>
android:id="@+id/ImageView1"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="2"
android:adjustViewBounds="true" >
</ImageView>
</LinearLayout>
<com.fsn.cauly.CaulyAdView
xmlns:app="http://schemas.android.com/apk/res/com.android.sangquiz"
android:id="@+id/xmladview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="150dip"
android:layout_alignParentBottom="true"
app:appcode="CAULY-3DTEST"
app:effect="LeftSlide" />
xmlns:app="http://schemas.android.com/apk/res/com.android.sangquiz"
android:id="@+id/xmladview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="150dip"
android:layout_alignParentBottom="true"
app:appcode="CAULY-3DTEST"
app:effect="LeftSlide" />
</RelativeLayout>
대략 이렇게 <RelativeLayout> 안에 <LinearLayout>을줘서 가중치를 잡아주니까
광고 영역까지 다 차지해서 잡히더라구요...
리니어에서 가중치를 광고부분을 제외한 영역에 주고 싶은데요.
가중치 주고싶은영역을 따로 설정할수있을까요?
해상도에 상관없이 출시하려고...가중치줘서 레이아웃 짜는 문제때문에
지금 출시할수도없어서.. 식음을 전폐하고있어요..
부디 작은 답변이라도 달아주시면 감사드리겠습니다.
그리고 선배님들과 고수분들은 가중치써서 잡아줄때 리니어를 많이잡으시나요 아님 테이블로 많이 잡으시나요?
그리고 스크롤뷰영역에는 원래 가중치가 먹지 않는건가요?
2013.01.14 11:43:06
CaulyAdView를 LinearLayout 위에 기재해주시구요.
LinearLayout속성에 높이를 android:layout_height="fill_parent"로 바꿔주시고 android:layout_above="@id/xmladview" 추가해보세요.
CaulyAdView를 LinearLayout위에 기재해야 android:layout_above="@id/xmladview" 에서 xmladview란 id를 찾아갈수있습니다.
여기서 주의할점은 @+id 가 아니고 @id입니다.
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_weight="1" > 이게 맞을겁니다.