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

  • Home
  • SEARCH
  • 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 8703091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:48:06+00:00 2026-06-13T02:48:06+00:00

I have a quite simple layout: <?xml version=1.0 encoding=utf-8?> <!– –> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/dialog_progress

  • 0

I have a quite simple layout:

<?xml version="1.0" encoding="utf-8"?>
<!--  -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/dialog_progress"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:background="@drawable/b"
    android:scaleType="fitXY" >

    <ProgressBar
        android:id="@+id/progressD"
        style="@android:style/Widget.ProgressBar.Horizontal"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="10dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="10dp"
        android:progress="0" />

    <TextView
        android:id="@+id/numberO"
        style="@android:style/TextAppearance.Large"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/progressD"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="10dp"
        android:textColor="#FFFFFF"
        android:textStyle="bold" />


</RelativeLayout>

And I inflate it like this:

public class MyFragment extends
    SherlockDialogFragment {

    static MyFragment newInstance() {
         MyFragment theDialog = new MyFragment();
         return theDialog;
        }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
        View v = inflater.inflate(
        R.layout.dialog_show_progress_during_connection_test,
        container, false);

And this is how I show it:

 public void showIt(final Device device) {
    //first create the DialogFragment to show the progress
    theDialog = theDialog
        .newInstance();

    theDialog.show(getSupportFragmentManager(),
        "dialog");

    getSupportFragmentManager().executePendingTransactions();
    }

The fragment is rather narrow – about 1/3 of the screen width, even though I explicitly have “match_parent”

Curiously on an old Android phone with Android 2.1 it inflates almost to the width of the screen – while on all others running Android 4+ it is narrow.

I checked the value of container, it is null in all cases. (shouldn’t it be the parent ?)

Could there be an issue with Sherlock?

I even set the width explicitly to 1000dp, but the new fragment remains narrow.
Also changing to LinearLayout does not help.

Any ideas what could be the reason for this?

The only way I got this to become wider was to set specific width like “500dp” in all places! within this xml file.
Many thanks!

  • 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-13T02:48:07+00:00Added an answer on June 13, 2026 at 2:48 am

    I have experienced that some attributes can override the layout_width-attribute. Try to remove layout_centerHorizontal, layout_centerVertical and scaleType from your RelativeLayout. As far as I can see, they fill no purpose either way.

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

Sidebar

Related Questions

I am stuck with something quite simple but really annoying: I have an xml
I have a very simple JLabel with a quite long text. The parent layout
I have a simple Table Layout with an empty row <TableRow android:id=@+id/range_input1 > </TableRow>
I am trying to get a quite simple layout in Android, but I just
I'm new to WCF data services. I have a quite simple data model. Some
The question is quite simple : I have a controller plugin for Zend Framework.
My problem is quite simple: I have a 400MB file filled with 10,000,000 lines
I have a problem that is quite simple to understand, but for me it
This should be quite simple, but I can't work out the syntax. I have
I have a macro to write, quite simple. It just pulls numeric values from

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.