2012-09-27 4 views
1

처리하는 방법을 선형 그래서 레이아웃 enter image description here안드로이드 : 내가 상대 layout..here으로 이일에서 붙어 상대 레이아웃

의 미세 내 화면 스냅입니다. 하지만 지금은지도에 새로 고침 버튼을 추가하고 싶지만 선형 레이아웃에서는 불가능하다는 사실을 발견했습니다. 그래서 나는 상대적인 레이아웃에서 시도했지만 위와 같이 화면을 얻을 수 없습니다. 내 바닥 글 레이아웃이 항상 상단에 표시됩니다 .. 여기에 어떤 도움이 크게 감사합니다

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/LinearLayout1" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical" > 

<!-- include title bar for all screen --> 

<include 
    android:id="@+id/include1" 
    layout="@layout/titlebar_layout" /> 


<com.google.android.maps.MapView 
    android:id="@+id/map" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_weight="1.63" 
    android:apiKey="0VkXbAOFvAq7b6uaGHSmnS2a2VosPxoS6ceHY_g" 
    android:clickable="true" > 
</com.google.android.maps.MapView> 

<include 
    android:id="@+id/include2" 
    android:layout_marginBottom="38dp" 
    layout="@layout/bottom_layout"/> 

</LinearLayout> 

내 XML 코드입니다. 미리 감사드립니다.

+0

어디서 새로 고침 버튼을 넣으시겠습니까 ?? – Renjith

+0

답장을 보내 주셔서 감사합니다 .i지도보기의 오른쪽 상단에 넣으시겠습니까 –

답변

2

시도해보십시오. 프레임 레이아웃을 사용하고 프레임 레이아웃 안에 mapview와 button을 넣으십시오. 따라서 버튼이지도 뷰 위에 배치됩니다. 필요에 따라 배치하십시오.

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/LinearLayout1" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical" > 

<!-- include title bar for all screen --> 

<include 
    android:id="@+id/include1" 
    layout="@layout/titlebar_layout" /> 


<FrameLayout android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_width="1.0" > 

    <com.google.android.maps.MapView 
     android:id="@+id/map" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1.63" 
     android:apiKey="0VkXbAOFvAq7b6uaGHSmnS2a2VosPxoS6ceHY_g" 
     android:clickable="true" > 
    </com.google.android.maps.MapView> 

    <Button android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="right" /> 

</FrameLayout> 

<include 
    android:id="@+id/include2" 
    android:layout_marginBottom="38dp" 
    layout="@layout/bottom_layout"/> 

</LinearLayout> 

희망이 있습니다 ... !!!

0

아마도 원하는 RelativeLayout입니다. 아래쪽보기 먼저을 정의한 다음 화면 위에 표시되는보기를 정의해야하므로 프로그램하기가 어려울 수 있습니다.

RelativeLayouts 사용에 대한 추가 지원이 필요하면 thesetutorials을 확인하십시오. 그것을 배우는 가장 좋은 방법은 그것을하는 것입니다! 규칙이 어떻게 작동하는지 알아낼 때까지 다양한 레이아웃을 시험해보십시오. 그렇다면 이것을 RelativeLayout으로 재현하는 것이 매우 간단해야합니다.

+0

의견을 남겨 주신 데 고마워요 .i 처음부터 다시 시도 할 것입니다. 감사합니다. –