Questions tagged [layout]

The layout tag is for questions about the placement, alignment and justification of objects with respect to a containing element. For questions pertaining to CSS, use the 'css' tag instead.

In computing, layout is the process of calculating the position of objects in space subject to various constraints. This functionality can be part of an application or packaged as a reusable component or library.

Android Development Examples:

HTML Examples:

26721 questions
181
votes
13 answers

Why this line xmlns:android="http://schemas.android.com/apk/res/android" must be the first in the layout xml file?

Why is this line needed in xml layout file? xmlns:android="http://schemas.android.com/apk/res/android"
Hitesh Dhamshaniya
  • 2,886
  • 3
  • 24
  • 31
180
votes
6 answers

Position absolute and overflow hidden

We have two DIVs, one embedded in the other. If the outer DIV is not positioned absolute then the inner DIV, which is positioned absolute, does not obey the overflow hidden of the outer DIV. #first { width: 200px; height: 200px; …
medihack
  • 16,045
  • 21
  • 90
  • 134
174
votes
16 answers

How to show android checkbox at right side?

By default android checkbox shows text at right side and checkbox at left I want to show checkbox at right side with text at left how do I achieve this?
UMAR-MOBITSOLUTIONS
  • 77,236
  • 95
  • 209
  • 278
174
votes
9 answers

Align items in a stack panel?

I was wondering if I can have 2 controls in a horizontal-oriented StackPanel so that the right item should be docked to the right side of the StackPanel. I tried the following but it didn't work:
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
170
votes
17 answers

Browser doesn't scale below 400px?

I'm working on putting together a liquid style-sheet and it works wonderful. One thing that I've noticed is that my browser window in Chrome won't resize below 400px it just gets stuck there and in FF as I scale down it it just stops at around 400px…
Brodie
  • 8,399
  • 8
  • 35
  • 55
169
votes
4 answers

Android: How to Programmatically set the size of a Layout

As part of an Android App I am building a button set. The buttons are part of a nested set of LinearLayouts. Using weight I have the set resizing itself automatically based on the size of the containing parent LinearLayout. The idea is, based on the…
codingCat
  • 2,396
  • 4
  • 21
  • 27
165
votes
2 answers

View inside ScrollView doesn't take all place

I have a RelativeLayout inside a ScrollView. My RelativeLayout has android:layout_height="match_parent" but the view doesn't take the entire size, it's like a wrap_content. Is there a way to have the real fill_parent/match_parent behavior ? My…
g123k
  • 3,748
  • 6
  • 42
  • 45
164
votes
13 answers

Add space between HTML elements only using CSS

I have several same HTML elements going one after another: 1 2 3 I'm looking for the best way of adding space between the elements using CSS only [no space] [1] [space 10px] [2] [space 10px] [3] [no…
Dan
  • 55,715
  • 40
  • 116
  • 154
162
votes
14 answers

Centering a view in its superview using Visual Format Language

I just started learning AutoLayout for iOS and had a look at Visual Format Language. It all works fine except for one thing: I just can't get a view to center within its superview. Is this possible with VFL or do I need to manually create a…
Christian Schnorr
  • 10,768
  • 8
  • 48
  • 83
161
votes
3 answers

Lock screen orientation (Android)

I'm writing an android application that uses tabs with different contents (activities). In one of these activities, I would like to lock the screen orientation to "Landscape"-mode, but in the other activities, I want the normal orientation…
user573536
  • 2,335
  • 3
  • 17
  • 8
157
votes
9 answers

How to position a table at the center of div horizontally & vertically

We can set a image as background image of a
like: