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
7
votes
0 answers

How to change the layout dynamically? How to add and remove layout objects properly?

I want to build an app with many plots. It will have some tabs, and one gridplot within the tabs with some plots. In addition, I need to update the plots layout dynamically when the server is running. Remove or add some plots Remove or add some…
ChesuCR
  • 9,352
  • 5
  • 51
  • 114
7
votes
2 answers

Make WPF/SL grid ignore a child element when determining size

I have a Grid which has several children, one of which is a ScrollViewer. I want the Grid to size itself based on all of its children except the ScrollViewer, which I want to just take up the space that is created by sizing the Grid for the rest of…
aggieNick02
  • 2,557
  • 2
  • 23
  • 36
7
votes
1 answer

Setting margin and gravity of textview in code doesn't work

If i set only margin for my textview, that is inside linear layout, everything works. If i set only gravity for my textview, it works. But if i set both attributes (gravity and margins), gravity remains left with margins set successfully. My code…
DixieFlatline
  • 7,895
  • 24
  • 95
  • 147
7
votes
3 answers

How to keep some of the components fixed when the soft keyboard comes in?

My application is a chat application, and its UI is: Header of the app List View Chat message, input box, and send button But the problem is when I click the edit text, the soft keyboard comes and pushes everything up, but I need the header to stay…
Prasad De Zoysa
  • 2,488
  • 2
  • 23
  • 30
7
votes
1 answer

Design Custom Android ViewGroup Subclasses

Android Developer has a nice discussion on writing your own View subclasses: http://developer.android.com/guide/topics/ui/custom-components.html But I want to write my own ViewGroup subclass with my own child positioning policy. Where is there a…
jimfwirth
  • 71
  • 1
  • 2
7
votes
3 answers

How to make multiple Views the same Width?

As part of a larger UI, I have a RelativeLayout with three Views that I would like to have the same width. The three views are "stacked" on top of each other like this ImageView TextView ImageView I've tried various things such as setting the…
Wesley Wiser
  • 9,491
  • 4
  • 50
  • 69
7
votes
4 answers

basics of device-independent-pixels

im throughoutly confused by dips on Android. I understand from the reference that the base for dp values is 160. So, shouldn't 80dp in width equals a view with a width of 50% of the screen ? On my Nexus One the width in dp is something around 300dp…
user577708
  • 71
  • 1
  • 1
  • 2
7
votes
3 answers

How do I set the android text view to cut any letters that don't fit in a layout

I have several TextViews in a row and I want the 1st TextView to take up all spare space but if the combined length of the TextViews is too long to fit on one line, I want the 1st TextView to be cut off. As for the spare space I have set the 1st…
Dre
  • 543
  • 1
  • 4
  • 17
7
votes
1 answer

PyQT5: Grid layout inside horizontal layout

Can someone help me figure out how to combine layouts? Taking offset from the guides from: [https://pythonspot.com/en/pyqt5/] I would rather not use Designer as the layout is going to be a part of several tabs that is determined based on the amount…
7
votes
1 answer

CSS - Center element if there is enough space

I'm working on a menu bar that's been designed with a logo/badge in the center of it. This works fine in the current situation (desktop with a few items) but if the screen is scaled or the amount of menu options increases, the logo gets put behind…
PixelSnader
  • 552
  • 1
  • 4
  • 9
7
votes
4 answers

Align items with different heights in a grid and have them match lines of alignment

I want to create a page where my elements are displayed in a Grid. I want to align the items by line. I want to achieve visually the following result, but I don't know how: https://codepen.io/shirkit/pen/KvZKOE/ And I currently have this: var back…
SHiRKiT
  • 1,024
  • 3
  • 11
  • 30
7
votes
2 answers

Relations between dip, px and dpi

If, in a layout xml file, I set the size to be, for example 12dip. Will that always be 12px in mdpi and so 18px in hdpi? So is dip always true for mdpi and will scale accordingly for other densities?
Espen
  • 3,607
  • 11
  • 48
  • 75
7
votes
4 answers

WPF ActualWidth is zero

I have a user control which has a Canvas of height 100 and width 1920. At the loading of the control, I go to an external source, download a text file and add TextBlocks to the Canvas. Then I want to create a marquee scrolling effect which should…
Mark
  • 14,820
  • 17
  • 99
  • 159
7
votes
2 answers

Execute jQuery code after all CSS rules have been applied

$(document).ready() executes the code when all HTML elements have been loaded. How to execute jQuery code after all of the CSS rules have been applied? I have few stylesheets linked to the page and it takes some time to load the page. Element layout…
takeshin
  • 49,108
  • 32
  • 120
  • 164
7
votes
1 answer

Display widget with based on sibling max width

I got a Column, it contains many Text entries of different sizes and I'd like to have them expand to the same width than the largest text. My Text entries are wrapped in a container with a Color and I want to align all them with the container so it…
Robert Felker
  • 890
  • 1
  • 9
  • 18
1 2 3
99
100