2017-12-20 2 views
2

私はテーブルレイアウトを使用してフォームを設計していますが、コンパイラは多くの属性が定義されていないか、許可されていないと訴えています。ここでは、レイアウトの抜粋です:私はコンパイルするときXamarin AndroidフォームデザイナーはGridLayoutレイアウトパラメータを認識しません

<GridLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:id="@+id/gridLayout1" 
    android:columnCount="2" 
    android:rowCount="2"> 
    <LinearLayout 
     android:orientation="vertical" 
     android:minWidth="25px" 
     android:minHeight="25px" 
     android:id="@+id/player1Layout" 
     android:layout_column="0" 
     android:layout_row="0" 
     android:background="@android:color/holo_green_dark" 
     android:layout_gravity="fill" 
     android:layout_columnWeight="1" 
     android:layout_rowWeight="1" 
     android:layout_margin="1" /> 

、私は警告とlayout_*属性に関連するエラーの両方を取得します。現時点では、私はかなり確信しているすべての3つのAPIレベル(コンパイル、ターゲット、および最小)26を、設定したこれらの属性のすべてを持っているが、私は、次のエラーを取得:

error APT0000: 1: error: Error: Integer types not allowed (at 'layout_margin' with value '1'). 
error APT0000: 1: error: Error: Integer types not allowed (at 'layout_margin' with value '1'). 
error APT0000: 1: error: Error: Integer types not allowed (at 'layout_margin' with value '1'). 
error APT0000: 1: error: Error: Integer types not allowed (at 'layout_margin' with value '1'). 

The 'http://schemas.android.com/apk/res/android:layout_column' attribute is not declared. 
The 'http://schemas.android.com/apk/res/android:layout_row' attribute is not declared. 
The 'http://schemas.android.com/apk/res/android:layout_columnWeight' attribute is not declared. 
The 'http://schemas.android.com/apk/res/android:layout_rowWeight' attribute is not declared. 
+0

のためのあなたのエラー「layout_margin」はい、それは可能に、整数型は許可されないための密度に依存しないポイント....このアンドロイドのようなもの:layout_marginRight =「1DP」 –

答えて

1

Error APT0000: 1: error: Error: Integer types not allowed (at 'layout_margin' with value '1').

使用dp単位、すなわち:

android:layout_margin="1dp" 
+0

ニース帽子、はい我々は同じ時間に両方の投稿... –

+0

ハァッ。奇妙な;私はデザイナのUIを介してそれを設定し、正しくWYSIWYGレンダリングを更新しました。 –

+0

@MichaelEdenfieldそこにいて、それをやった;-) – SushiHangover

関連する問題