2011-07-29 34 views
1

我想在Imageview對象上使用視圖動畫。我已經爲rotate.xml文件定義了一個。但是我得到了文件中的錯誤: -元素類型「旋轉」必須後跟任一屬性規格,「>」或「/>」。

1)元素類型「rotate」必須後面跟着屬性規範,「>」或「/>」。 2)錯誤:錯誤解析XML:沒有很好地形成(標記無效)

這裏是我的rotate.xml文件: -

<?xml version="1.0" encoding="utf-8"?> 
<rotate 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:interpolator="@android:anim/linear_interpolator" 
    android:fromDegrees="0" 
    android:toDegrees="180" 
    android:pivotX="50" 
    android:pivotY="50" 
    android:repeatCount="infinite" 
    android:duration="3000"> 

</rotate> 
+0

之間的空間'>'和'/>'它可能試圖解釋之間的空間? –

+2

嘗試項目 - >清潔。在我的項目中沒有顯示任何錯誤。 – ania

+0

@Justin,你的建議奏效了。問題在於空間解釋。 我通過使用Android文件創建器顯式創建名爲rotate.xml的動畫xml文件,然後逐個放置每個屬性來解決此問題。 – Ruchira

回答

3

如果刪除</rotate>/>取代>會發生什麼它可能試圖解釋發生什麼情況,如果你刪除``和替換<rotate></rotate>

+0

@ruchira - 請接受此答案,以便人們知道這解決了您的問題。 –

相關問題