Click here to Skip to main content
11,928,078 members (37,596 online)
Rate this:
Please Sign up or sign in to vote.
See more: Mobile 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 4:09am

1 solution

Rate this: bad
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 );
azhar eqbal 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2015
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