Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8417337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:00:52+00:00 2026-06-10T02:00:52+00:00

Hai all I am new in android programming….. For my application I am using

  • 0
  1. Hai all I am new in android programming…..

    For my application I am using image button and it successfully
    installed on the device. But when I rotate the screen all the button
    position get changed… and I need all the button placed at centre
    of the screen…. And here is my code….

    <TextView
        android:id="@+id/testText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#FFCC99"
        android:textSize="24dp" />
    
    <ImageButton
        android:id="@+id/up"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginRight="124dp"
        android:layout_marginTop="80dp"
        android:src="@drawable/up" />
    
    <ImageButton
        android:id="@+id/left"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_below="@+id/up"
        android:layout_marginRight="200dp"
        android:layout_marginTop="150dp"
    
        android:src="@drawable/left" />
    
    <ImageButton
        android:id="@+id/right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_below="@+id/up"
        android:layout_marginRight="50dp"
        android:layout_marginTop="150dp"
        android:src="@drawable/right" />
    
    <ImageButton
        android:id="@+id/down"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/up"
        android:layout_alignParentRight="true"
        android:layout_marginRight="124dp"
        android:layout_marginTop="80dp"
        android:src="@drawable/down" />
    

    Please help…………

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:00:54+00:00Added an answer on June 10, 2026 at 2:00 am

    Set android:gravity to center.
    The following layout will do for you:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:orientation="horizontal" >
    
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Cool Button" />
    
    </LinearLayout>
    

    There are other ways to do it.
    1. Using relative layout
    2. Using 2 layouts : 1 one for portrait and and 1 for landscape.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hai am Calling the webservice in my android application am using android version(r-18).but i
Hai All, I'm developing the application using .net 2008 and Oracle 10g as database.
hai my images are gallery all image display in same view but i expect
Hai, Am using DevExpress LookupEdit in C#.NET application.I want to clear all items in
Hai all, In my iphone application i want to open a my custom application(available
hai all, in my iphone application i have a login view with two text
Hai i am new bie to Android. i need to check the network connection
Hai i developed a application in android,in my application i used a dynamically created
hai.all..can you tell me how to make table in jquery? i want using this
Hai i developed a application using broadcast receiver.I need to wake my Application always.so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.