2012-03-22 18 views
0

エミュレータの丸い角の背景形状に問題があります。実際にはわかりません。次のように丸みを帯びたコーナーが動作しない(アンドロイドエミュレータで)

形状コードは:

以下相対レイアウトで使用
<shape xmlns:android="http://schemas.android.com/apk/res/android"> 
    <corners android:radius="50dip" /> 
    <stroke 
     android:width="1dip" 
     android:color="#ccffffff" /> 
    <solid 
     android:color="#cc111111" /> 
    <padding 
     android:left="3dip" android:top="3dip" 
     android:right="3dip" android:bottom="3dip" /> 
</shape> 

グラフィカルレイアウトに

<RelativeLayout 
      android:id="@+id/loginboxlayout" 
      android:layout_width="190dp" 
      android:layout_height="240dp" 
      android:layout_centerInParent="true" 
      android:background="@drawable/rounded" 
      android:padding="0dp" > 
(...) 

</RelativeLayout> 

、日食で、正しく表示されますが、エミュレータ上ではdoesnの't:screenshots

私はアンドロイド4.0を使用しています。

ありがとうございます。

答えて

3
res>layoutフォルダ内の

プット形状ファイルと、その後

<RelativeLayout 
      android:id="@+id/loginboxlayout" 
      android:layout_width="190dp" 
      android:layout_height="240dp" 
      android:layout_centerInParent="true" 
      android:background="@layout/rounded" 
      android:padding="0dp" > 
(...) 

</RelativeLayout> 
+0

まあ...すでにres/drawableになっていましたが、bin/res/drawableに入れなければなりませんでした。ありがとう:)確かに – takecare

0

Rect.xml ---(描画可能なフォルダにこのXMLを入れて)

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="rectangle" android:padding="10dp" android:paddingTop="50dp" 
    android:layout_marginLeft="50dp"> 
<solid android:color="#eeeee0" android:paddingLeft="25dp" /> 
<stroke android:width="0.8dp" android:color="#000000" /> 

<corners android:bottomRightRadius="15dp" 
    android:bottomLeftRadius="15dp" android:topLeftRadius="15dp" 
    android:topRightRadius="15dp" /> 

そして、それを追加どこに丸めたいと思っても何でもコントロールできます。

android:background="@drawable/rect" 

これは間違いなく動作します。

+1

のために:それは要素がありません:) –

0

dipをsize formateとして使用しないでください。代わりにdpを使用してください。

そして

<corners android:radius="50px" /> 

代わりの

<corners android:radius="50dip" /> 

を交換してくださいそれはあなたの問題を解決します。

Emjoy。 :)

関連する問題