Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Android
i am developing an application in which there are two buttons say Button1 and Button2,Button2 appears only in some special condition,what i am trying to do is when Button2 appears Button1 should change its position,ie it should be shifted to side of the screen,any idea or help to achieve this will be greatly appreciated.Thanks.
Posted 19-Dec-12 3:09am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can try using the setLayoutParams[^] method of the button[^].
 
Create an AbsoluteLayout[^] object with the dimension and coordinates you want.
AbsoluteLayout.LayoutParams layout = new AbsoluteLayout.LayoutParams(width, height, xPosition, yPosition);
and use it to set the new position of the button
Button1.setLayoutParams( layout );
  Permalink  
Comments
azhar eqbal at 20-Dec-12 1:56am
   
@Andre,though i have not tried it yet but i appreciate your concern towards my problem,ThankYou So Much!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 6,745
1 OriginalGriff 6,696
2 CPallini 5,315
3 George Jonsson 3,599
4 Gihan Liyanage 2,650


Advertise | Privacy | Mobile
Web01 | 2.8.140922.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100