Skripnikov Gleb
Skripnikov Gleb

Reputation: 13

Element set doesn't have required attribute layout_height

The LinearLayout tag complain

'layout_height' attribute should be defined
'layout_width' attribute should be defined

This is my alpha_anim.xml:

  <?xml version="1.0" encoding="utf-8"?>
  <set
  xmlns:android="http://schemas.android.com/apk/res/android">

  <translate
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromXDelta="0%"
    android:toXDelta="0%"
    android:fromYDelta="200%"
    android:toYDelta="0%"
    android:duration="2000"
    android:zAdjustment="top"/>

   </set>

What is wrong here?

Upvotes: 1

Views: 2789

Answers (2)

Jorgesys
Jorgesys

Reputation: 126495

The reason is that this element isn´t a layout, is an animation, you must create (if it doesn´t exist) the folder /anim (inside /res) and then place the file inside.

enter image description here

Upvotes: 1

Flo We
Flo We

Reputation: 345

Put it in the res/anim/ folder. Create if it doesn't exist. Should also work in the res/drawable/ folder.

Upvotes: 1

Related Questions