FAQ Database Discussion Community


How do I automatically `layout_below` sequential controls in an Android layout?

android,layout
I often seem to make Android layouts that have a series of controls that are meant to sit one below the other. For example <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:id="@+id/a"/> <TextView android:id="@+id/b" android:layout_below="@+id/a"/> <TextView android:id="@+id/c" android:layout_below="@+id/b"/> <TextView android:id="@+id/d" android:layout_below="@+id/c"/> <TextView android:id="@+id/e" android:layout_below="@+id/d"/>...

How to put a layout below other layout in Android

android,layout
I have this code: RelativeLayout frame = new RelativeLayout(activity); RelativeLayout layout = new RelativeLayout(this); RelativeLayout.LayoutParams dateArea = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MATCH_PARENT, 90); dateArea.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); DisplayMetrics displayMetrics = this.getResources().getDisplayMetrics(); int height = displayMetrics.heightPixels; RelativeLayout mapLayout = new RelativeLayout(this); RelativeLayout.LayoutParams mapParam = new RelativeLayout.LayoutParams(...

trouble with GridBagLayout and panels

java,swing,layout,layout-manager
So what I am trying to do is create this: I am using a gridbag layout and here is what I have so far: public class board { public static void addComponentsToPane(Container pane) { pane.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); JPanel leftTop = new JPanel(); leftTop.setPreferredSize(new Dimension(251,300)); leftTop.setBackground(Color.black); c.fill...

How to apply layout constraints to in windows phone 8.1?

layout,windows-phone-8.1
How can I apply layout constraints to layout so that it auto adjusts it self for every device like we apply in iOS? The app I developed leaves blank spaces when I run it on higher size devices.

addOnLayoutChangeListener vs addOnGlobalLayoutListener vs post(Runnable r)

android,layout,view,measure
PROBLEM: Suppose we have simple case: we have view and we have to show some data on this view. We use static method showData(View view) to do this. I want to know the exact moment when view layout is measured and I can access getWidth() getHeight() and be sure that...

Where to place SlidingTabLayout.java and SlidingTabStrip.java files in project?

java,android,layout
I'm very new to Android studio and I'm currently following a tutorial that implements a sliding tab layout for an application. The tutorial says to put SlidingTabLayout.java and SlidingTabStrip.java in our project, but doesn't say exactly where. For now, I just put declared them as two classes and put them...

Dynamically Resizing Controls on Windows Forms

c#,winforms,layout
I has a winform which can be resize. I has 4 chart control in the form and sit side by side. When the form is in maximum size, the layout of each chart control is run out. I try to set the anchor style but i got no luck. How...

Modern webdesign and effects?

layout,design,contao
I found this template: http://preview.premium-contao-themes.com/quantumflat/demo/blog.html Now I Was wondering, when I scroll down, the navigation resizes und stays fixed, how can I do this. And when i resize the browser, the boxes in the content area are resizing and reanranging as well, how can I do that? Thanks in advance...

Drawing a tournament bracket in android?

android,canvas,layout
I have an app that will take a list of players and set them up so that you can go through and create a bracket dynamically. The number of players will change and the names as well. Instead of showing a whole bracket, my point will be to go in...

Custom TextView with icon

android,layout,textview,icons,drawable
I need to obtain some TextView with a custom icon on them, such as these ones: but I've only been able to do this: my 3 TextView: <LinearLayout android:id="@+id/info" android:layout_marginTop="80dp" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerHorizontal="true" android:orientation="horizontal" android:layout_marginEnd="16dp" android:layout_marginRight="16dp" android:layout_marginLeft="16dp" android:layout_marginStart="16dp"> <TextView android:id="@+id/info_totali"...

ListView fill the width of parent, screen or whatever [duplicate]

wpf,layout,windows-phone-8.1
This question already has an answer here: ListViewItem won't stretch to the width of a ListView 1 answer I am trying to display some data from an Observable Collection to a ListView. Binding is working fine. My only problem I cannot fix is the layout of the ListView.I use...

Allow absolutely positioned child to render outside parent with overflow: hidden

css,layout,overflow
How to allow for absolutely positioned element to disobey it's ancestor overflow: hidden and render outside it? The situation is complicated by the fact that there is a position: relative on the element between them in the ancestor hierarchy. Here's a pen. In this situation how to allow red inner...

Inline block challenges and suggestions for the layout

css,layout,css-float,navbar
I keep reading articles that floats are outdated and that using inline-block solves problems such as having to use clearfix and a few more. These articles go on to justify inline-block by showing the same example: three squares that are aligned middle. In trying to use inline-block to create a...

CSS with IPhone Chat layout

html,ios,css,layout,chat
I'm trying to create a page wich will be used to send/receive SMS, I want to show when each SMS was sent/received but I can't seem to be able to align the date right... Here is my jsfiddle: https://jsfiddle.net/xazvruqj/2/ EDIT: My jsfiddle was missing the actual CSS ... This part...

With TableLayout margin, TableRows bleed

android,layout
I'm creating a Settings screen, a ScrollView with a TableLayout inside. I don't want my settings TableRows to appear squished, so I'm setting each with an 8dp margin. However, this means the content inside seems to bleed over (on the right side in particular). It seems as if the width...

Border some cells in table via CSS

css,layout,border,cells
In a very basic table I would like to put a border around some specific cells. I created for instance this table: <?php echo '<link rel="stylesheet" type="text/css" href="style1tt.css">'; echo '<table>'; echo '<tr> <th>name</th> <th>score</th> <th>position</th></tr>'; echo '<tr> <td>Bart</td> <td>189</td> <td>2</td></tr>'; echo '<tr> <td>Shirley</td> <td>211</td> <td>1</td></tr>';...

Move textview from top to bottom

android,xml,android-layout,layout
In the image above I want to move the textview containing bill microsoft under the image and the other textview. How can I do this? I have written this layout right now. <android.support.v7.widget.CardView android:id="@+id/card_tracks" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="180dp" android:layout_gravity="center" android:layout_margin="16dp" android:elevation="7dp"> <LinearLayout android:id="@+id/main_ll" android:layout_width="match_parent"...

Rendering both layout and view, rails

ruby-on-rails,layout,render
I have next mistake: Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect here respond_to do |format| format.html { render layout:"productView" render "show2" } ajax_respond format, :section_id => "user_tab_comments" format.js end So I want to render both layout and...

xcode buttons overlap despite constraints

ios,xcode,layout,constraints
I am working with a series of 4 buttons. All same width and height that combined stretch the width of the view. I have tried visually constraining them to each other and to a label (also the width of the view) above them. I used the Leading edge to view...

How to aligning textviews on the left and right side of a linearlayout

android,layout,android-linearlayout
According to below codes <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_vertical|center_horizontal" android:layout_marginTop="15dip"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="نوع" android:gravity="left" android:layout_weight="1" android:id="@+id/txt_type" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="تاریخ:...

Horizontally centering a child element with no set width inside a parent with a constrained width

html,css,layout
I have a set of divs which act as markers. At the foot of the marker I have numbers. I'd like to center these numbers but the challenge so far is doing it within a div with a constrained width of 4px. I managed to accomplish this by explicitly giving...

Seekbar progress drawable show wrong issue when its progess value is zero

android,layout,seekbar
I am new in android platform. I am trying to develop the custom seek bar using .9 path image and xml.I created almost but my problem is occurs when seekbar is appear first time when activity start its show wrong progress level when my progess level is define 0 in...

One controller uses its corresponding layout, but the other does not

ruby-on-rails,layout
My Rails project has two controllers, a SessionsController and a CustomersController. My project also has two layout views in the layouts directory, sessions.html.erb and customers.html.erb. I would like the SessionsController to render using the session.html.erb layout and the CustomersController to render using the customers.html.erb layout. I have removed all explicit...

Strange layout issue

android,layout
I am using a relative layout, and this is a section taken from it: <ImageView android:id="@+id/btnLifeMinus5" android:layout_width="50dp" android:layout_height="50dp" android:background="#2a80b9" android:visibility="invisible" android:adjustViewBounds="false" android:clickable="true" android:cropToPadding="false" android:padding="0dp" android:scaleType="fitStart" android:layout_marginLeft="0dp" android:layout_marginTop="0dp" /> <ImageView android:id="@+id/btnLifePlus5" android:layout_width="50dp"...

Layouts with two different colors

android,android-layout,layout,background-color
I am trying to obtain something like this: by using A RelativeLayout with light grey (#EEEEEE) and a LinearLayout with a bit darker grey (`#9E9E9E), but despite the difference in color I am not obtaining a visible contrast... My code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <!--android:background="@mipmap/background_poly"-->...

Android set margins for control inside webview doesn't work

android,layout,webview
I have a webview, a functionality that add a new button to this webview, the problem here is I can't not set the margins to this button and it always show on the top, left of webview. Or any solutions for my situation: I want to add a control at...

Adding Margin/Padding to a RatingBar

java,android,xml,layout,drawable
I have an image of a rating bar like this: Now, I would like to know how would I add a margin/padding to each item in the rating bar? styles.xml <resources> <style name="starRatingBar" parent="@android:style/Widget.RatingBar"> <item name="android:progressDrawable">@layout/starratingbar_full</item> <item name="android:minHeight">19dp</item> <item name="android:maxHeight">19dp</item> </style> </resources> starratingbar_full.xml <?xml version="1.0" encoding="utf-8"?>...

Why declaring @+id is allowed in other than id attributes

android,xml,layout
So lastly I have had to rebuild not my XML layout file for android app. And I saw constructions like <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <LinearLayout android:id="@+id/rev_main" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/rev_arrow"> <!-- some stuff in here --> </LinearLayout> <ImageView android:id="@+id/rev_arrow"...

I can get layout from other applications but NOT with image(drawable)

image,layout,drawable
I'm trying to add a THEME feature in my app protector application but i faced a big problem. I can get layout from other application but the layout doesn't present the drawable (ex. Background, Src, ...) (ex. If i make a theme app with a layout whose background is "background.png",...

Android Google Map in FragmentDialog being overlayed by the Dialog's own gray overlay

android,google-maps,android-layout,android-fragments,layout
I just migrated a MapView from an Activity's layout to a DialogFragment. It was a pretty painless migration: A button on the activity launches the dialog, setting the LatLng the map requires: case R.id.btn_open_map: android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager(); DirectionsMapDialogFragment mapDialogFragment = new DirectionsMapDialogFragment(); mapDialogFragment.setLatLng(mLatLng); mapDialogFragment.setRetainInstance(false); mapDialogFragment.show(fragmentManager, "fragmentName"); break; In the...

Position JavaFX Button in a specific location

button,layout,javafx,position,location
My Question is how can i position a javafx button in a specific location. All the time that i tried to do this simple code is resulting that the Button is only located in the Center of the screen and not on my desired location. (I'm using StackPane) Code: Button...

SWT Text Widgets in StackLayout—Can't adjust height when switching top control

java,layout,swt
I have a SWT Composite in a JFace Dialog. On one row of the composite I have a Group with 4 buttons stacked vertically. Next to it is a Text widget which needs to toggle back and forth, by user input, between being multi and single-line. I have two different...

Plug-in: com.android.ide.eclipse.adt error

java,android,eclipse,layout
when I'm trying to add a Toggle Button I get an error, would you please help me here? I added a text.xml as a layout and I'm filling it. and the description is: java.lang.ArrayIndexOutOfBoundsException: -1 at android.view.ShadowPainter.createDropShadow(ShadowPainter.java:116) at android.view.ShadowPainter.createDropShadow(ShadowPainter.java:48) at android.view.ViewGroup_Delegate.getPathShadow(ViewGroup_Delegate.java:140) at android.view.ViewGroup_Delegate.drawShadow(ViewGroup_Delegate.java:77) at...

Android: how to programmatically get layout's width

android,layout
Well, the title is not really exhaustive but it's how I would fix the problem. If there are other solutions, they are welcome. I'm testing my app in 2 emulators and this is the output: It's a row of an ExpandableListView and contains a title on the left and a...

Alfresco custom data list layout

layout,alfresco,datalist,alfresco-share
I have created a custom data list in Alfresco, and have populated its model with the desired data columns. However, when I view the list in Alfresco share, the order is completely off, and there are elements that I have not defined in the model. I have searched extensively as...

Android - overlaid layout is forcing transparency on a button element

android,layout,transparency
I have my main home screen, but after it loads I want to display an overlaid wheel selector that will go away once a choice is made. Everything has gone well so far except that the submit button for the wheel selector is having some transparency forced upon it. I've...

Padding in android, untidy my layout

android,layout
I have this layout inside a linerar layout (It is a custom Dialog), and when i add padding in the buttons, my layout become untidy. <RadioGroup android:id="@+id/toggleGroupEntrega" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <ToggleButton android:id="@+id/toggleButtonEntregaOK" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp" android:background="@color/bgOff" android:checked="false" android:paddingLeft="5dp"...

Android - Swap Linear Layouts Dynamically

android,layout,views
I have a situation where I need to swap 2-5 linear layouts. The linear layouts are fixed in xml and currently they are either visible or gone. In some cases, I now require the visible layouts to rearrange. Can anyone suggest some quick work around?...

CSS two columns without specific widths

css,layout,css-float
I am trying to port a simple two column table to use div and float. I need the feature of a table that is able to scale the width of all columns to the largest content (without taking the whole browser width), but would like the added feature of floats...

Java Layout Manager tips [closed]

java,user-interface,layout
I created a small program. The jframe of it is exactly the same with the attached one. and I built it with absolute layout. but I want to try other layouts. So the question is can you guys tell me which layouts can be suitable for the jframe attached .

listfragment android layout

android,layout
I'm trying to create a layout in my fragment that allows a user to enter their workout. The fragment has an ArrayList of sets, and each set consists of an exercise name, sets/reps, and rest time. I can only populate so many sets at the beginning, and want to add...

Elements not sitting side by side (Complex Grid) There is space, but acts as if there isn't

html,css,css3,layout,susy
Having problems executing a complex layout with minimal usage of relative and absolute positioning. Here's my layout: All my elements are floating left sitting side by side with only a single problem: the border img needs to bleed down into the next row. How can I do that while preventing...

Placing two containers among each other

html,css,layout,containers
I have some layout problems. If you look at the fiddle here, there are two container, contentAbout and contentPortfolio. My problem is that I can't set those divs correctly among each other. There is always a space between. Maybe you could give me some tips to get this working. This...

Space Between Sections in UITableview

ios,uitableview,swift,layout
I need to reduce the space between two sections ofUITableView. I looked at this question but the solution doesn't allow for my custom header view because it combines the space of the footer and header. Here is a picture of the UITableView. The black color is the UITableView background color....

Pyqt: Graphics view next to another widget

python,layout,pyqt
I am trying to set up a graphics view next to a custom widget that acts as a container. The graphics view is taking up the entire window. I tried explicitly setting the size but that dose not seem to work. I also added another widget in place of the...

How to make QR Page Footer or Band to be under Band Details not at the page end?

delphi,layout,report,quickreports
I need to make report, that has summary after Details had printed, not after every each Detail. I only know the Page Footer, but it's at page bottom not after the Detail Band. Is there a QRBand that could go after Detail Band? Or can you make PageFooter height resize...

QML ScrollView with ColumnLayout

c++,layout,qml,qt5
I am trying to create a scroll view around a ColumnLayout, unfortunately my current code doesn't work. I know about ListView, but in my case I need to create scrollable Layout, because it will contain heterogeneous elements. ApplicationWindow { id: mainwindow title: qsTr("Hello World") width: 300 height: 300 visible: true...

Possible to change border position based on adjacent blocks in CSS?

css,css3,layout
I'm using a flexbox layout with a few blocks that can wrap. I'd like each block to create a border dynamically depending on its position relative to adjacent blocks. For example, if it is to the right of a block, I'd like a border on its left-hand side. If it...

Expand child elements of wx.GridBagSizer on Panel on wx.Notebook

python,layout,wxpython,wxwidgets,wx
I have a simple application with wx.Notebook, it looks like this: To lay out its child elements, I used wx.GridBagSizer - and it works perfectly. However, I encountered a small but annoying issue. When I expand the window of wx.Notebook, it does not expand all the elements and results in...

breaks out the layout

css,html5,layout,flexbox,doctype
I have the following simple html code for a simple template: <!DOCTYPE html> <html> <head> <title>My new website</title> <meta name="description" content="Simple website styled using flex box layout"> <meta http-equiv="refresh" content="60"> <link rel="stylesheet" type="text/css" href="style1.css"> </head> <body> <div class="mainContainer"> <nav class="mainMenu"> <ol> <li> <a href="#">Home</a> </li> <li> <a...

Why these ImageButtons(delete and update) are overlaying

java,android,xml,layout
this .xml will be the layout of the item in the RecycleView list, but the last two Buttons are overlaying <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#Ffffff" android:baselineAligned="false" android:weightSum="1"> <LinearLayout android:id="@+id/thumbnail" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="3dip"...

How to achieve the following in extjs

extjs,layout,header,panel
--Title------------------------------- | | | | | <Content> | | | |_____________________________________| How to achieve the above panel in extjs? Edit: It should look something like this: http://oi57.tinypic.com/eiw49.jpg...

How to add CustomView to layout

java,android,xml,layout
I know that there are lot of questions about "How to add CustomView to Layout" but I read almost all and i have still problem. CustomView in XML <slccs.drawingapplication.DrawLine android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/drawline"/> And Java code of this View package slccs.drawingapplication; import android.content.Context; import android.view.View; public class DrawLine extends View {...

How to increase the indent size in (Cloud9)

layout,ide,indentation,cloud9-ide
In my cloud9 editor, I somehow have for some files that my indent is 3 characters and for others 7. Is there a way to harmonize this and have the same indent everywhere? Is there perhaps also an auto-indent? Example of indent with 3 characters: function indent3() { // code...

How to define rectangle of visible children in Flash/AS3 (“real” element size)

actionscript-3,flash,flex,canvas,layout
I use BitmapData.draw to make a snapshot of a graph canvas. On the canvas located some children in random positions (including negative positions). I should to define in some way what rectangle bounds to shoot. SO, for example, i have 3 nodes in the view (canvas): {10x10, (-5; -3)} {20x20,...

arange horizontal line of buttons in Pyside/PyQT/Qt

qt,button,layout,pyqt,pyside
I want to create a simple GUI with PySide/PyQt. In this GUI I want to have a raw with severeal push buttons and the length of the buttons I want to be proportional to its text label. Looking at QPushButton and QHBoxLayout I don't see a posibility this can be...

Ext JS Dashboard Layout and maximize/minimize panels

extjs,layout,dashboard,extjs5,panels
I'm attaching a picture with the mock up that I'm trying to develop with Ext JS. I'm using a Border layout, and then a Dashboard for the central part, however I see some limitations on it: Panels in the dashboard don't have minimize or maximize button. How can I implement...

Android easiest way to set layout for orientation

android,layout,orientation
I add android:configChanges="orientation|keyboardHidden|screenSize" in manifest and create two xml activity_main(port) and layout(land) under res folder.I want to set it change between two layout when I rotate ,how to edit my code? Thanks After I change twice the method under oncreate is not works. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent"...

tkinter - mistake in the layout

python,canvas,layout,tkinter,label
In the code below, I want the label on line 34 to go to the top of my canvas, as the label on line 59 does. But it goes to the bottom of my canvas instead, even though I'm using the same code in both places. Here is my code...

How to make Search Dialog size of a toolbar

android,search,layout,toolbar,search-dialog
So I learned how to make Search dialog with this tutorial but it doesn't look pretty and I'm looking for proper way to fix it. As you can see search widget doesn't cover fully the toolbar and I think making it shorter by using constant dp values is not a...

How to create layout that use header and footer partials

php,layout,view,yii2
I have red the guide about views and layouts, I have googled how to to this, but I still can not make it work. Here is the problem: I want to have 2column.php and 3column.php layouts, where both are using _header.php and _footer.php partials. 2columns.php layout example: render _header.php $content...

Bootstrap layouts - Flexible columns

layout,bootstrap
I am trying to implement bootstrap layouts for my dashboard application. Here is code that I have found on Internet that I am adapting. <div class="container"> <div class="col-md-4"> <!--panel--> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-md-6">col1</div><div class="col-md-6">col2</div> </div> </div> </div> </div> </div> It works great, except that when...

CSS 3 Column Layout Collapses Under Large Screen Width

html,css,css3,layout
I have the following section of code for by CSS 3-Column Layout. However under a very large screen width, the first column collapses (around 2000px). I added the code for the navigation, as the links could be impacting the display of the columns. CSS and HTML #container { width: 75%;...

Change extends(layout) dynamically in laravel 5

layout,laravel-5
I have been trying to change layout dynamically in laravel by just passing a variable in @extends('default1.master') to $var = default2 @extends('$var.master') possibly @extends($var.'.master') tried a lot but unable to find a solution all I get is error in my syntax or view not found....

UILabel is not centered in my UIView

ios,objective-c,iphone,layout,uiview
I'm adding a UILabel to a UIView on initialization and the label will not center itself. I've tried centering it is layoutSubviews and adding constraints programmatically with no luck. When it appears it is about 200 pixels to the left of the center. Here is my code. Thanks in advance....

Android layout button lower than others in horizontal linearlayout

android,xml,button,layout,margin
for some reason the button on the right comes out lower. I have attempted to edit the different parts, am I missing a margin difference or is it because of space fitting in. It is simply a linear layout horizontal with a textview, edit text and button. Screenshot of the...

Add block to all CMS Pages with certain URL Key

magento,layout,content-management-system
I'm trying to discover whether this is possible or not. We have a series of CMS pages that represent our library. So the URL keys for these pages are something like: library/ library/top-ten library/five-questions library/faq etc... The powers that be want to add a static block that will appear only...

Nested linear layout in frame layout causing issues

android,android-layout,layout
I have tried several different versions of my layout but each of them is having some not working symptoms. I just wanted to have a working slide menu. Option one (nested linear layout in frame layout): <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <!-- Framelayout to display Fragments --> <FrameLayout android:id="@+id/frame_container"...

Android Button orders to front automatically

android,button,layout,order,bringtofront
something weird is happening to me. I have this layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/gray_dark" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true"...

Change colour of imageView programatically

android,layout,imageview
I would simply like to change the colour of an imageView object using code, but it appears to be proving a lot more difficult than it sounds. Here is my xml for the object: <ImageView android:id="@+id/lifeSquare" android:layout_width="50dp" android:layout_height="30dp" android:background="#2a80b9" android:visibility="invisible" android:adjustViewBounds="false" android:clickable="true" android:cropToPadding="false" android:padding="0dp" android:scaleType="fitStart" /> It's just a blue...

Understanding weight and layout_weight, the bigger layout_weight is, more it shrinks in the layout.

android,xml,android-layout,layout
I am trying to understand the weight layout with this example. It is definitely not a rocket science. However, this example making it... The weightSum dictate how big the size is and Then divide the layout based on layout_weight value for the view in LinearLayout. In this example I have...

How do you make a div only extend in one direction when the outer container size increases?

javascript,html,css,css3,layout
I'm trying to make a a page container with a navigation bar on the left (inside of the container). When the outer page is wider than the container, I would like just the navigation bar to extend left up to a certain size while the rest of the container's contents...

MVC5/Bootstrap: adding to Nav doesn't push body content down

layout,twitter-bootstrap-3,navigation,asp.net-mvc-5.1
I am working in VS2013 U4 with an MVC/bootstrap website and when I add to the nav/menu, it's not pushing everything down, the top of the body is getting cut off. I have two sub-menus that show depending on what controller(s) the user's hitting. When they show up, it cuts...

How to apply custom CSS and Javascript specific CMS page Magento

javascript,css,layout,magento-1.9
I want to add lightbox for playing videos on my one specific CMS page. I placed my CSS file in JS/MY THEME/JQUERRY/PLUGIN/VENOBOX/CSS/myfile.css and JS files in JS/MY THEME/jquery/plugins/venobox/js/myfile.js, but it didn't works. I am doing everything, but not working. I use the following code in Layout Update XML of my...

CSS: display:inline-block not aligning divs correctly

html,css,layout
I'm having some trouble getting my divs to align correctly, though I know the basic idea is sound. What I want is for the larger div (bound) to have the title, bonus, and image all on the same row, however currently the bonus appears below the title field. Any ideas?...

java Swing: how to keep one component left aligned with another component centered with respect to parent

java,swing,layout,jpanel,layout-manager
Say I have two components, A and B, in a JPanel. I want Component A to stay left aligned, while Component B does its best to stay in the middle of the panel. I mocked up the following demo (sorry for the quality, I made it in paint): What I...

Adding margins to listview

android,listview,layout
I am following a tutorial and I did not understand why exactly the margins that I applied to a list view contained within a relative layout does not affect the look when I test it on a device. However, if I put everything in a LinearLayout container it looks as...

Eclipse Layout: static instead of relative values?

android,eclipse,layout
I have a layout with two Buttons. One button is in the Center of the left half, and the other button is in the Center of the right side. But I use relative values (left="60dp" etc.). How can I have the same result with static values? Because I don't want...

Toolbar above keyboard Android

android,layout,keyboard
I´m trying to put two views on my Activity, but I just need show them when the Keyboard is open. How can I do that? I was looking for a tutorial or something but I find more about iOS than Android. Also I put a toolbar as the last one...

What happens when only high resolution layouts are defined?

android,xml,android-layout,layout
I have been handed a project that is oddly constructed. Almost all the layouts are in the res/layout-xhdpi/ and res/layout-xxhdpi/ directories. The normal res/layout/ directory is practically empty. So I'm curious as to what precisely happens when low-res devices run this app. Are the layouts simply scaled down, or is...

strange behaviour with UINavigationController and autolayout top layout guide

ios,layout,uiscrollview,uinavigationcontroller,autolayout
I am using auto layout for a controller under navigation controller. For this controller, I mainly have a scroll view inside the controller's view. the alignment rule for the scroll view is top layout guide, bottom layout guide, leading aligned with super view and trailing as well. the layout is...

XML layout is different once loaded

android,xml,layout
I've a layout with a 16 buttons, every button has an image and a textview under the image. I've this buttons in a particular order,but once is loaded in the activity the order is not the last i've edited but remain the previous! Why in the editor of eclipse is...

Error Parsing XML: not well formed (invalid token)

xml,android-layout,layout
I'm receiving the following message when compiling my android project: Error Parsing XML: Not well-formed (Invalid token) This is the XML layout file where the error is supposed to be: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="0.5"...

html remove unknown whitespace

html,css,layout,paragraph
I have this 3 column layout on CSS and HTML #content{ width: 100%; padding: 0 15px 0; margin:0px; } #content-left{ width: 20%; display:inline-block; } #content-main{ width: 55%; display:inline-block; } #content-right{ width: 20%; display:inline-block; } <div id="content"> <div id="content-left"> <p>Lorem ipsum....</p> </div> <div id="content-main"> <p>Lorem ipsum....</p> </div> <div id="content-right"> <p>Lorem ipsum....</p>...

An activity with two listviews in android

android,android-layout,android-activity,layout,android-listview
MainAcitivity public class MainActivity extends Activity { ListView list, listYear; String[] web = { "Google Plus", "Twitter", "Windows", "Bing", "Itunes", "Wordpress", "Drupal" } ; String[] year = { "2012", "2013", "2014", "2015", "2016", "2017", "2018" } ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); list=(ListView)findViewById(R.id.list); list.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, web));...

iOS / XCode Auto Layout Woes. Easier Way?

ios,iphone,xcode,layout,constraints
I'm wondering if xCode auto layout / constraints are really as frustrating as I think, or am I just not understanding them. For example, I started with this basic label in the view controller: Fair enough. A box with text that has equal margins on the left/right and a smaller...

A way to adapt the position of items in an android layout

java,android,xml,layout
I am currently work on an Android project, I have to show several check-box, now they are in a Relative Layout and all are positioned to their left neighbor. So in landscape, I have a line of check-box, the problem is if I switch in Portrait the line is cut,...

SWT removing margin from Composite

java,layout,swt
When I embedding Composite control inside ViewPart, a vertical margin/padding is added between textbox and button (button is part of another Composite) , as seen on attached picture. How can I remove it? public class View extends ViewPart { public static final String ID = "xyyx.view"; public void createPartControl(Composite parent)...

UICollectionView layout issue on iphone 5

ios,objective-c,layout,uicollectionview,uicollectionviewlayout
I have a problem with my UICollectionView, I have 3 columns and everything works fine instead of iphone 5 and 4. In iphone 6 my collectionview looks that (width in cell): Iphone 5 with cells: The problem is, when in last row, I have 2 cells, and it looks like...

Designing layout android

android,layout,design,linear
I am currently trying to create a list view which will show details about a post. For that, I have created xml file for designing the list item. This is the final look I want for my activity. So far I have succeeded dealing with the rounded corners, image buttons...

css disable / null row without using display: none

html,css,layout
I have a series of divs that I am using to display data in a tabular fashion. This is what I currently have: But this is what I am trying to change the css to achieve: I cannot change the HTML (namely the <.div.class='row'.> must stay in place) because the...

How to use custom css file for layout of a module in Yii2

php,css,layout,module,yii2
I am using basic pack of Yii2. I created a module named Admin and I want this module has it own layout but i don't know where to put all its css files. Then, how to include them in layout.php. My dirs like this: basic -- module -- admin --...

What's the layouts folder for in Rails?

ruby-on-rails,layout
I understand that .html.erb files go within app/views or its subfolders. But what is the app/views/layouts folder in particular for in Rails?

Android Design Support TabLayout overlapping content

android,layout,tabs,android-toolbar,androiddesignsupport
I am using the new TabLayout introduced in the design support library. I have the code like this: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent"> <android.support.design.widget.CoordinatorLayout android:id="@+id/lines_coordinator" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent"...

Get error in Swing java - IllegalArgumentException

java,swing,layout
Tried to put on frame some swing components. This code worked to days ago. Now it's not work, didn't nothing. Maybe somebody can tell me what it's wrong? public static void main(String[] args) { JFrame mainFrame = new JFrame(); mainFrame.setSize(500, 400); //Size of frame mainFrame.setTitle("Cinema City"); //Set title mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel...

Why the 20px gap at the top of my UIViewController?

ios,layout,uiviewcontroller,xamarin
The Problem Consider the following controller hierarchy: UINavigationController UIViewController UITableViewController The presence of the UIViewController is affecting layout. Without it, the UITableViewController takes up the entire bounds of the UINavigationController: However, if I add a vanilla UIViewController between the UINavigationController and UITableViewController, a 20px gap appears between the top of...

how do i get rows and columns dynamically in windows phone app?

windows-phone-8,layout,windows-phone-8.1
In my application i need to design the seat layout arrangement in the form of rows and columns dynamically. Please any one suggest me how to get rows and columns and which view i need to use. this my xaml code <Grid x:Name="grid" Background="White"> <Button HorizontalAlignment="Stretch" Foreground="Black" Margin="23,56,268,527">Text</Button> </Grid> this...

Header for first tableview section is bigger than the rest

uitableview,swift,layout
I am making a custom uitableview. However the header for the first section is bigger than the others. Here is the code: func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { var header = UIView(frame: CGRectMake(0, 0, tableView.bounds.width, 30)) header.backgroundColor = UIColor(red: 223/255.0, green: 170/255.0, blue: 128/255.0, alpha: 1.0) return...

XML resource id not found

android,xml,layout
So, i have xml layout, and i get no errors, and even the graphical preview view shows how the layout looks, but when i call the activity that uses this layout, i get some error, that i do not know how to handle.... Here is the xml: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"...

Error composing layouts with django-crispy

python,django,layout,django-crispy-forms
I want to build several forms in Django with django-crispy using a common layout. I read the crispy documentation about composing layouts, but I cannot made it all by myself, because I get the message error: append() takes exactly one argument (2 given). See my code below: # a class...