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 8547975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:23:15+00:00 2026-06-11T13:23:15+00:00

I am creating a application for android, wherein i am facing one strange kind

  • 0

I am creating a application for android, wherein i am facing one strange kind of problem. The problem is that I’ve positioned the button in the center of the screen which is shown the same way in the GRAPHICAL LAYOUT of the file, but when i run the application in emulator the button is positioned more towards the right side and not centered. Can anyone point out the problem.

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:panel="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#CCC"
android:orientation="vertical" >

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <org.miscwidgets.widget.Panel
        android:id="@+id/mytopPanel"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="4dip"
        panel:animationDuration="1000"
        panel:closedHandle="@drawable/top_switcher_collapsed_background"
        panel:content="@+id/mypanelContent"
        panel:handle="@+id/mypanelHandle"
        panel:linearFlying="true"
        panel:openedHandle="@drawable/top_switcher_expanded_background"
        panel:position="top" >

        <Button
            android:id="@+id/mypanelHandle"
            android:layout_width="fill_parent"
            android:layout_height="33dip"
            android:paddingRight="50dp" />

        <LinearLayout
            android:id="@+id/mypanelContent"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <EditText
                android:id="@+id/editTextUserName"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_margin="3dp"
                android:layout_marginTop="6dp"
                android:hint="@string/editUserName" >
            </EditText>

            <EditText
                android:id="@+id/editTextPassword"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_margin="3dp"
                android:hint="@string/editUserPwd" >
            </EditText>

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="#323299"
                android:gravity="center"
                android:padding="4dip"
                android:text="@string/drpDwnTxt"
                android:textColor="#eee"
                android:textSize="16dip"
                android:textStyle="bold" />
        </LinearLayout>
    </org.miscwidgets.widget.Panel>

    <EditText
        android:id="@+id/editTextNumber"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="3dp"
        android:layout_marginTop="6dp"
        android:hint="@string/editNumber" >
    </EditText>

    <EditText
        android:id="@+id/editTextMessage"
        android:layout_width="fill_parent"
        android:layout_height="100dp"
        android:layout_margin="3dp"
        android:hint="@string/editPwd" >
    </EditText>

    <Spinner
        android:id="@+id/spinnerGateway"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:drawSelectorOnTop="true"
        android:entries="@array/spinnerList"
        android:prompt="@string/spinnerPrompt" />

    <Button
        android:id="@+id/btnSend"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="3dp"
        android:onClick="save"
        android:text="@string/StrbtnSend" >
    </Button>
</LinearLayout>

</FrameLayout>

enter image description here

  • 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-11T13:23:17+00:00Added an answer on June 11, 2026 at 1:23 pm

    This new layout file has done the job for me, just one small error was creating the trouble.

    <?xml version="1.0" encoding="utf-8"?>
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:panel="http://schemas.android.com/apk/res-auto"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#CCC"
    android:orientation="vertical" >
    
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
        <org.miscwidgets.widget.Panel
            android:id="@+id/mytopPanel"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            panel:animationDuration="1000"
            panel:closedHandle="@drawable/top_switcher_collapsed_background"
            panel:content="@+id/mypanelContent"
            panel:handle="@+id/mypanelHandle"
            panel:linearFlying="true"
            panel:openedHandle="@drawable/top_switcher_expanded_background"
            panel:position="top" >
    
            <Button
                android:id="@+id/mypanelHandle"
                android:layout_width="wrap_content"
                android:layout_height="33dip"
                android:layout_gravity="center_horizontal" />
    
            <LinearLayout
                android:id="@+id/mypanelContent"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >
    
                <EditText
                    android:id="@+id/editTextUserName"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="3dp"
                    android:layout_marginTop="6dp"
                    android:hint="@string/editUserName" >
                </EditText>
    
                <EditText
                    android:id="@+id/editTextPassword"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="3dp"
                    android:hint="@string/editUserPwd" >
                </EditText>
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="#323299"
                    android:gravity="center"
                    android:padding="4dip"
                    android:text="@string/drpDwnTxt"
                    android:textColor="#eee"
                    android:textSize="16dip"
                    android:textStyle="bold" />
            </LinearLayout>
        </org.miscwidgets.widget.Panel>
    
        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >
    
            <AutoCompleteTextView
                android:id="@+id/mmWhoNo"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_marginTop="10dp"
                android:layout_toLeftOf="@+id/btnContact"
                android:hint="To: Type to search"
                android:textSize="13sp" />
    
            <Button
                android:id="@+id/btnContact"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:layout_alignParentRight="true"
                android:layout_marginTop="10dp"
                android:background="@drawable/contacts_icon"
                android:textSize="18dp" >
            </Button>
        </RelativeLayout>
    
        <EditText
            android:id="@+id/editTextMessage"
            android:layout_width="fill_parent"
            android:layout_height="100dp"
            android:layout_margin="3dp"
            android:hint="@string/editPwd" >
        </EditText>
    
        <Spinner
            android:id="@+id/spinnerGateway"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:drawSelectorOnTop="true"
            android:entries="@array/spinnerList"
            android:prompt="@string/spinnerPrompt" />
    
        <Button
            android:id="@+id/btnSend"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_margin="3dp"
            android:text="@string/StrbtnSend" >
        </Button>
    
        <TextView
            android:id="@+id/txtAuthor"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="Designed By - Tapan Desai" />
    </LinearLayout>
    
    </FrameLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Actually, I am facing a problem in Android. I am creating an application that
I am creating an application for android OS. The problem im facing is that
I'm creating an android application and within it there is a button that will
I'm creating an application in Android, for which I need to divide the screen
I am creating an android application in which there are two activites. One activity
I am creating one android application which will have API to create a new
I'm creating an android application, which has a particular screen (layout) with over (120+
I'm creating an android application which should parse a Json from a file or
I'm creating an Android application that requires the following: Data from RSS feed gets
I am creating an android application in which I am using table layout in

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.