margins

create and set margin programmatic for relative layout android

你离开我真会死。 提交于 2020-01-23 17:13:32
问题 Hi I am developing android application in which I am creating relative layout programmatic and tried to set margin for that and Added it into linear layout which have orientation linear. So here is my code: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/screen_background" tools:context=".ChooseChannelsFragment" >

CSS: Margin problem with Safari

给你一囗甜甜゛ 提交于 2020-01-14 04:35:28
问题 On the site I'm working on, for some reason the margin is needing to be different for Safari than in FF, IE8, Chrome & Opera? I have a link that I want lined up next to a label. It's lining up fine in all but Safari which needs a 12 pixel difference. Here's a screenshot to better describe the issue: Click The Safari screenshot shows the label down too low. This is the CSS I use for the working 4 browsers: .submitter a { float: right; margin: -2px 0 0 2px; padding: 0 !important; } And here's

CSS margin strange behavior, why?

筅森魡賤 提交于 2020-01-11 10:10:14
问题 Having the HTML below <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <div style="width:400px;height:200px;background-color:Gray;margin-bottom:10px;"></div> <div style="width:400px;height:200px;background-color:Green;margin-top:10px;"></div> </body> </html> the space between those two DIVs is only 10 pixels. Why? Explain please. 回答1: That behavior is called collapsing

Remove margin in android toolbar icon

蹲街弑〆低调 提交于 2020-01-10 00:59:29
问题 I get this weird margin in my app toolbar between icon and navigation icon in the toolbar (as in the image). I've got no idea about where it comes from and how to remove it. After searching the internet I found this: <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_height="wrap_content" android:layout_width="match_parent" android:fitsSystemWindows="true"

Measuring margin of a “fitCenter” imageView in Android

依然范特西╮ 提交于 2020-01-06 02:41:08
问题 Given a simple RelativeLayout like this: <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#0fffff"> <ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center" android:adjustViewBounds="true" android:scaleType="fitCenter" android:src="@drawable/img001" /> </RelativeLayout> the left/top spacing between the layout border and the image border depends on the W/H ratio of the image being

How to increase the inner margin of a ggplot boxplot in facet_grid?

与世无争的帅哥 提交于 2020-01-05 16:12:45
问题 I am setting up boxplots to present these in a ggplot2 facet_grid and I would like to increase the inner margin. Unfortunately, I am not able to increase the distance to the frame of the facet. How could I increase the inner margin (left and right) as indicated by the blue arrows? require(ggplot2) dat <- rbind(data.frame(approach=1,product=1,value=seq(1,20,0.5)), data.frame(approach=1,product=2,value=seq(5,15,0.3)), data.frame(approach=1,product=3,value=seq(5,17,0.2)), data.frame(approach=2

How to increase the inner margin of a ggplot boxplot in facet_grid?

我的梦境 提交于 2020-01-05 16:12:21
问题 I am setting up boxplots to present these in a ggplot2 facet_grid and I would like to increase the inner margin. Unfortunately, I am not able to increase the distance to the frame of the facet. How could I increase the inner margin (left and right) as indicated by the blue arrows? require(ggplot2) dat <- rbind(data.frame(approach=1,product=1,value=seq(1,20,0.5)), data.frame(approach=1,product=2,value=seq(5,15,0.3)), data.frame(approach=1,product=3,value=seq(5,17,0.2)), data.frame(approach=2

Why does adding overflow: hidden make the child element's margin work?

☆樱花仙子☆ 提交于 2020-01-04 05:12:30
问题 When I add an element like h1 with margin: 30px 0; , the margin goes outside the container! I faced this problem many times before, and I solved it by using overflow: hidden I want to figure out what's the problem and why this solution works? Find a JSFiddle here https://jsfiddle.net/LeoAref/zv6c2c2d/ .container { background: #ccc; } .container.overflow { overflow: hidden; } .secTitle { margin: 30px 0; } code { color: blue; } <!-- secTitle margin goes outside the container --> <div class=

how set margin between spannable textview?

喜欢而已 提交于 2020-01-02 07:06:47
问题 I am trying to create spannable textview and showing it in EditText. So user can type something in EditText and if user pressed enter button of keyboard then i am converting this text in to spannable textview after this user can start typing again and press enter button of keyboard then again second spannable textview will create ans will show it in edittext but. Where i stuck? when i create two spannable textview then this two textview slightly overlapping on each other. And i want to set

Item with margin-top has margin outside of containing box

邮差的信 提交于 2020-01-02 00:59:04
问题 I have something to this effect: #div { background: green; width: 200px; height: 100px; } h1 { margin-top: 100px; } (And obviously there is some HTML to go with it.) Now when viewed in the browser the h1 shows at the very top of the #div and the 100px margin goes on top of the #div . Can anyone suggest a reason? (The code is a little too complicated to insert the relevant parts so if no-one can give me an answer then I will post it and maybe someone will spot an error or something.) 回答1: Try