2012-01-20 3 views
0

私はマップ上にデバイスの位置を表示しようとしています。私は私のアプリを稼働させたが、地図は表示されない。私はmap api keyのような一般的なエラーをたくさん読んだ。私の携帯電話はサムスン銀河2.1です。私はGoogle api8に対してビルドしていることに気づいた。だから私はいくつかのことをちょっと混乱させ、プロジェクトを削除してsrcファイルをコピーして新しいプロジェクトにペーストしなければならなかった。新しいプロジェクトは現在google api7に対して構築されています。相対レイアウトエラーaginst google api7 build

main.xmlファイルにエラーがあるという問題があります。私が考えることができるのは、プロジェクトがapi8の代わりにapi7に対して構築されたものを変更したことだけです。何か案は?

error: Error: String types not allowed (at 'layout_width' with value 'match_parent'). 

[編集]エラーがrelativelayoutタグ

です。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:orientation="vertical" android:layout_width="match_parent" 
       android:layout_height="wrap_content" android:gravity="fill"> 
    <com.google.android.maps.MapView 
     android:id="@+id/myGMap" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:enabled="true" 
     android:clickable="true" 
     android:apiKey="02wE28syQIHzpwXXa95CrtA1XJLU5segJgltvKQ" 

    /> 

    <EditText android:id="@+id/edittext1" 
      android:inputType="text" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      /> 

    <Button android:layout_height="wrap_content" 
      android:layout_width="wrap_content" 
      android:text="CLOSE" 
      android:layout_alignParentRight="true" 
      android:id="@+id/close" ></Button> 

</RelativeLayout> 

答えて

0

はい、APIレベル7には、match_parent属性がありません。代わりにfill_parentを使用する必要があります。

+0

おかげで、私は10分で受け入れるでしょう:) – turtleboy