2011-12-08 11 views
0

中に私のエラーを示しています。アンドロイド:角丸のXMLの使用は、私はこのコードを使用して丸い境界線を作成しています私のアプリケーションで開発

<?xml version="1.0" encoding="UTF-8"?> 
<shape  
    xmlns:android="http://schemas.android.com/apk/res/android">  
    <stroke   
      android:width="1dip"   
      android:color="#ffffff"/>  
    <solid 
      android:color="#95865F"/> 
    <corners 
      android:radius="10px" 
      android:topRightRadius="0dp" 
      android:bottomRightRadius="0dp" /> 
    <padding 
      android:left="1dp" 
      android:right="1dp" 
      android:top="1dp" 
      android:bottom="1dp"/> 

私はこれをやっている間にすべてがうまく動作しますが、日食中でGraphocalLayout下の画像のようなエラーメッセージが表示されます。 enter image description here

これは何が間違っていますか?そして私はこのメッセージを取り除きたいのですが、どうすればいいのですか?おかげさまで

+0

'android:radius =" 10px "'を削除し、 'topLeftRadius'と' bottomLeftRadius'を追加しようとしましたか? – SERPRO

+0

ストローク:幅を大きくすることもできます。私はこれに一度踏み込んだことを思い出しているようで、私はそれが私のためにやったと思います。 –

+0

http://stackoverflow.com/questions/8399517/why-i-am-not-able-to-create-the-round-border-for-specific-corner後:実際のデバイスで動作し、グラフィカルなレイアウトのプレビュー? – Renaud

答えて

1

インディゴとADT 15で、最初から、ここでの結果である:

Eclipse capture

私は描画可能/ cornered_bg.xmlであることを得る:

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" > 
    <stroke   
      android:width="10dip"   
      android:color="#ffffff"/>  
    <solid 
      android:color="#95865F"/> 
    <corners 
      android:radius="100px" 
      android:topRightRadius="0dp" 
      android:bottomRightRadius="0dp" /> 
    <padding 
      android:left="1dp" 
      android:right="1dp" 
      android:top="1dp" 
      android:bottom="1dp"/> 
</shape> 

とレイアウト/ main.xml:

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

    <TextView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/hello" /> 

</LinearLayout> 
android:radius値を変更する作業を行い

...しかしすべてコーナーは、(それが実際のデバイス上でOKです)丸みを帯びています。

確かにグラフィックレイアウトの制限。 http://code.google.com/p/android/issues/listhttp://tools.android.com/knownissuesを検索して参照することをお勧めします。私はこの問題に関連するものは何も見つけ出していないので、試してみてください。何も見つからなければ、チケットを開くことができます。

+0

ありがとう。チケットを開ける方法は?どんな解決策も見つけられていないので。 –

+0

新しい問題のボタン(http://code.google.com/p/android/issues/listの左上) – Renaud

+0

をクリックします。http://code.google.com/p/android/問題/詳細?id = 22720&colspec = ID%20Type%20Status%20Owner%20Summary%20Stars – Renaud

0

次のことを試してみてください。

<?xml version="1.0" encoding="UTF-8"?> 
<corners 
     android:topLeftRadius="10px" 
     android:topRightRadius="0dp" 
     android:bottomLeftRadius="10px" 
     android:bottomRightRadius="0dp" /> 
+0

あなたはそれを試してみましたか?答えのために –

関連する問題