AbsoluteLayout is deprecated ????


Last Updated:

  1. aryaxt

    aryaxt Member This Topic's Starter

    Joined:
    Jun 1, 2010
    Messages:
    21
    Likes Received:
    0
    it says "AbsoluteLayout is deprecated"
    but the code works fine.
    is there another way to do such a thing without getting this warning?
    Should i ignore the warning?
    Code (Text):
    1. AbsoluteLayout l = (AbsoluteLayout)findViewById(R.id.layout);
    2. l.addView(myCustomButtonOnRunTime);
     

    Advertisement
  2. aryaxt

    aryaxt Member This Topic's Starter

    Joined:
    Jun 1, 2010
    Messages:
    21
    Likes Received:
    0
  3. KlaymenDK

    KlaymenDK Well-Known Member

    Joined:
    May 29, 2009
    Messages:
    1,217
    Likes Received:
    130
    Why? Because you don't get an answer to your very specific and expertise-requiring question within one hour?

    I'd say that as long as it compiles, ship it! It may not work on the newest devices, but it should work on older devices.
     
  4. aryaxt

    aryaxt Member This Topic's Starter

    Joined:
    Jun 1, 2010
    Messages:
    21
    Likes Received:
    0
    Thanks for the answer,
    the iphone dev forum i used before was a lot faster.
    I think a developer forum should be separated from a general forum, that might be why.
     
  5. dmitriyk

    dmitriyk Active Member

    Joined:
    Apr 17, 2010
    Messages:
    44
    Likes Received:
    10
    Either ignore the deprecation or use another layout container. A RelativeLayout will do just about anything an AbsoluteLayout will, without relying on positioning using screen pixels.
     
  6. cp1

    cp1 Well-Known Member

    Joined:
    Apr 30, 2010
    Messages:
    375
    Likes Received:
    35
    Is there a way to ignore the OP? I can't find it by clicking on his name.
     
  7. aryaxt

    aryaxt Member This Topic's Starter

    Joined:
    Jun 1, 2010
    Messages:
    21
    Likes Received:
    0
    Thanks, i actually switched all my forms from RelativeLayout to AbsoluteLayout
    But 1 question is it possible to add for example a button to the AbsoluteLayout at runtime, and specify a certain x and y for it?
    Based on my understanding in RelativeLayout each object doesn't have it's own possition (x and y), on the screen, and the location of each object can only be based on another object.
    Am i wrong?
     
  8. dmitriyk

    dmitriyk Active Member

    Joined:
    Apr 17, 2010
    Messages:
    44
    Likes Received:
    10
    You're not wrong. You can still define margins and padding for elements within a RelativeLayout, but that sort of misses the point.

    If you really need absolute positioning, use an AbsoluteLayout and ignore the deprecation warnings.
     
    aryaxt likes this.
  9. aryaxt

    aryaxt Member This Topic's Starter

    Joined:
    Jun 1, 2010
    Messages:
    21
    Likes Received:
    0
    Thanks again for the answer, 1 more thing. Is there any way i can find out if AbsoluteLayout will be removed from the sdk or not?
    From my understanding deprecated classes will get removed at one point.
     
  10. kevin@teslacoilsw

    kevin@teslacoilsw VIP Member VIP Member

    Joined:
    Jun 13, 2010
    Messages:
    183
    Likes Received:
    130
    aryaxt likes this.

Share This Page

Loading...