Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>According to me, the problem you are facing is not a problem, it is the way how Android is used to design the layouts.</p> <p>This means that you can set the height and width with 3 default constant values:</p> <p><strong>FILL_PARENT</strong><br> Special value for the height or width requested by a <code>View</code>. <code>FILL_PARENT</code> means that the View wants to be as big as its parent, minus the parent's padding if any. This value is deprecated starting in API Level 8 and replaced by <code>MATCH_PARENT</code>.</p> <p><strong>MATCH_PARENT</strong><br> Special value for the height or width requested by a <code>View</code>. <code>MATCH_PARENT</code> means that the view wants to be as big as its parent, minus the parent's padding if any. Introduced in API Level 8.</p> <p><strong>WRAP_CONTENT</strong><br> Special value for the height or width requested by a <code>View</code>. <code>WRAP_CONTENT</code> means that the <code>View</code> wants to be just large enough to fit its own internal content, taking its own padding into account.</p> <p>Now, when you are setting the <code>View</code>'s height/width to <code>WRAP_CONTENT</code>, you are allowing the view to take that much size that is sufficient to show to view's content. The background image is also the <code>View</code>'s content, hence you view will be shown of as much size as the image. That's not a problem, that's how it's shown.</p> <p>Okay, but in your situation that's an issue for you because you have a background to show and view should not be stretched for that. I can suggest few ways:</p> <ol> <li><p>First and very obvious: make correctly sized images and keep them in different <a href="http://developer.android.com/guide/practices/screens_support.html" rel="nofollow noreferrer">drawable folders</a>.</p></li> <li><p>Specify the size of view not using <a href="http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#FILL_PARENT" rel="nofollow noreferrer">constants</a>, but in <a href="https://stackoverflow.com/questions/2025282/difference-of-px-dp-dip-and-sp-in-android">DP</a>. If it becomes necessary, make different layout XML files for different sizes and keep them in <a href="http://developer.android.com/guide/practices/screens_support.html" rel="nofollow noreferrer">layout folders</a>.</p></li> <li><p>You can use a very useful thing for design layout is <a href="http://developer.android.com/resources/articles/layout-tricks-efficiency.html" rel="nofollow noreferrer">layout weight</a>.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload