Piyush
Piyush

Reputation: 548

Changing the position of Image view at run time

I want to make an application in which a Loading text is there and some dot images in front of them. I want that images are shown after some time period continuously until background work is completed or can i change the position of an image view at run time which is in absolute layout. Please share exact running code, I need it.

Upvotes: 0

Views: 10523

Answers (4)

GaneshKumar
GaneshKumar

Reputation: 53

if you want to move imageview in absolute layout use setX() and setY() method .But this method are not supported in below 3.0 verson

Upvotes: 0

bhavindesai
bhavindesai

Reputation: 809

if you want to move imageview then you have to take relative layout and you need to increase leftPadding to move imageview horizontally.

ImageView leaf = (ImageView)findViewById(R.id.imageView1);

par = (LayoutParams)leaf.getLayoutParams();
par.leftMargin += 30;

leaf.setLayoutParams(par);

Upvotes: 6

Macarse
Macarse

Reputation: 93133

You shouldn't be using AbsoluteLayout since it's deprecated.

You can set the Text invisible as Kurru said or use an Animation to make it go out of the screen.

Upvotes: 0

Kurru
Kurru

Reputation: 14321

You could call setVisiblity(View.GONE) to hide the loading animation whenever you've loaded the page

Upvotes: 1

Related Questions