2014-10-01 46 views
0

这是我的activity_main.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" > 

    <Spinner 
    android:id="@+id/spr_place_type" 
    android:layout_width="wrap_content" 
    android:layout_height="60dp" 
    android:layout_alignParentTop="true" /> 

    <Button 
    android:id="@+id/btn_find" 
    android:layout_width="wrap_content" 
    android:layout_height="60dp" 
    android:layout_alignParentTop="true" 
    android:layout_toRightOf="@id/spr_place_type" 
    android:text="@string/str_btn_find" /> 

    <fragment xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/map" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_below="@id/spr_place_type" 
    class="com.google.android.gms.maps.SupportMapFragment" /> 

    </RelativeLayout> 

我已经发布过这个但尚未解决问题......任何人都可以解决这个问题对我来说?

+0

我想预览的GoogleMaps是根本不可能的。你为什么不尝试运行它而是直接查看它? – mr5 2014-10-01 09:21:05

+0

我试过你的代码它工作正常......;) – Umair 2014-10-01 09:22:46

+0

... ** cudnt ** ?? ** ** rilly? – 2014-10-01 09:25:08

回答

0

我试图像这样所有的项目都显示精细尝试它,然后根据自己的需要进行设置..

<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" > 

<Button 
    android:id="@+id/btn_find" 
    android:layout_width="match_parent" 
    android:layout_height="60dp" 
    android:layout_alignParentTop="true" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="40dp" 
    android:text="@string/str_btn_find" /> 

<Spinner 
    android:id="@+id/spr_place_type" 
    android:layout_width="wrap_content" 
    android:layout_height="60dp" 
    android:layout_alignParentLeft="true" 
    android:layout_below="@+id/btn_find" /> 

<fragment 
    android:id="@+id/map" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_below="@+id/spr_place_type" 
    android:layout_marginTop="19dp" 
    class="com.google.android.gms.maps.SupportMapFragment" /> 

</RelativeLayout>