标签: margin

Vb.net - 设置控制边距值

所以,我正在以编程方式添加标签,我需要将上边距稍微改为值8.我不能以明显的方式做到这一点,所以我的想法出了什么问题?

Dim LabelAdapter As New Label
LabelAdapter.text = "Adapter"
LabelAdapter.Margin.Top = 8
Run Code Online (Sandbox Code Playgroud)

这给了我错误"表达式是一个值,因此不能成为赋值的目标".

vb.net controls margin winforms

12
推荐指数
1
解决办法
2万
查看次数

LinearLayout忽略了保证金

我正在创建包含a的动态视图LinearLayout并将它们添加到外部LinearLayout.我想在创建的视图周围设置边距,但layout_margin忽略XML文件中的边距.如果我在代码中设置参数,它可以工作,但我想在布局XML中指定边距.

设置XML布局中的边距将被忽略:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="20dp"
    android:orientation="vertical" >

    ...
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

在创建时设置边距是值得尊重的:

LinearLayout productView = (LinearLayout) getLayoutInflater().inflate(R.layout.product_preview, null);

LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
params.setMargins(50, 50, 50, 50);  
productView.setLayoutParams(params);
Run Code Online (Sandbox Code Playgroud)

这是外部布局.视图已添加到dealer_activity_product_list.

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/dealer_activity_dealer_image"
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:contentDescription="@string/dealer_activity_dealer_image_desc" />

    <TextView
        android:id="@+id/dealer_activity_dealer_address"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <LinearLayout
            android:id="@+id/dealer_activity_product_list1"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical" />

        <LinearLayout
            android:id="@+id/dealer_activity_product_list2"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical" />
    </LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

layout android margin android-linearlayout

12
推荐指数
1
解决办法
5902
查看次数

颤振布局容器边距

我的Flutter布局有问题.

我有一个简单的容器,右边和左边的边距为20.0.在这个容器内,我有另一个容器.

但是这个容器只适合左侧的父容器.我不知道为什么会这样.

这是我的代码:

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      backgroundColor: Colors.white,
      body: new Container(
        margin: new EdgeInsets.symmetric(horizontal: 20.0),
        child: new Container(

        )
      ),
    );
  }
Run Code Online (Sandbox Code Playgroud)

问题的截图

layout containers margin dart flutter

12
推荐指数
3
解决办法
3万
查看次数

通过javascript获取元素的位置

我已经看过十几个脚本可以捕获页面中元素/对象的x和y位置.但是当网页在主体上使用边距或其他元素,绝对/相对元素(如此类似)时,我总是遇到捕捉x和y的问题.

无论使用什么边距或填充,是否有提供精确位置的解决方案.

:)

javascript position margin absolute

11
推荐指数
3
解决办法
4万
查看次数

表获得1px的不需要的填充

出于某种原因,我在桌子上得到1px填充或边框.我无法弄清楚如何摆脱它.我已经尝试添加display:block;margin:0;padding:0;到图像,但这并没有解决它.我也试着<table border="0">border:none;在CSS.对于我的生活,我无法弄清楚这一点.

这是一个问题的原因是因为我试图让图像与tr两侧的边缘对齐,以给它圆形边框,因为CSS3 border-radius不适用于TR.我已经添加table, table * {border:1px solid red;}到CSS,从那里,它肯定看起来像填充或边距问题.

问题出在这张图片中:

在左侧和右侧,您可以看到图像和桌子边缘之间存在某种填充或某种东西.红色边框只是为了看到这一点.

这是我的CSS:

table a {
    color: #f7941E;
    font-family: Arial;
    font-size: 16px;
    font-weight: bold;
    /* css3 */
    transition: color .25s;
    -khtml-transition: color .25s;
    -moz-transition: color .25s;
    -o-transition: color .25s;
    -webkit-transition: color .25s;
}

    table a:hover {
        color: #f8ae57;
    }

table {
    width: 610px;
}

    table tr {
        height: 33px;
        padding: 0;
        margin: 0;
        vertical-align: middle;
    }

        table td {
            border-collapse: collapse;
        }

    table …
Run Code Online (Sandbox Code Playgroud)

html css html-table margin padding

11
推荐指数
2
解决办法
1万
查看次数

底部边距或填充在android上的xml中的相对布局中不起作用

我有一RelativeLayout排进入一个ListView.这行看起来像,

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/relativeLayout1" 
    android:layout_width="wrap_content"
    android:layout_height="fill_parent">

    <ImageView
        android:id="@+id/placeDetailIcon_Img"
        android:layout_height="50dp"
        android:layout_width="50dp"
        android:layout_alignParentLeft="true" 
        android:paddingBottom="20dp"
        android:paddingTop="20dp" 
        android:paddingLeft="20dp"
        android:paddingRight="20dp"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

我还尝试了保证金:

 <ImageView
    android:layout_height="50dp"
    android:layout_width="50dp"
    android:id="@+id/placeDetailIcon_Img" 
    android:layout_alignParentLeft="true" 
    android:layout_marginRight="10dp"
    android:layout_marginTop="10dp"
    android:layout_marginLeft="10dp"
    android:layout_marginBottom="10dp">
Run Code Online (Sandbox Code Playgroud)

没有应用边距或填充围绕ImageView.如何创建这种类型的间距?

android margin padding imageview

11
推荐指数
1
解决办法
2万
查看次数

内联元素的边距顶部

我的问题很简单:

为什么firefox中的内联元素忽略了上边距?

有人知道吗?

html css inline margin

11
推荐指数
1
解决办法
9954
查看次数

设置绑定边距

我有一个绑定值,返回一个int,表示我没有分配给元素的左右边距的值.

继承人我尝试过但它不会编译.

如果我设置整个边距,它可以工作,但我只想要左右.

XAML:

<Image x:Name="_image" Source="mat.png" Margin="{Binding EditorRow.BondIndent},0,{Binding EditorRow.BondIndent},0" />
Run Code Online (Sandbox Code Playgroud)

类:

public int BondIndent
{
    get { return _bondSequence * 5; }
}
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml binding margin

11
推荐指数
2
解决办法
2万
查看次数

带有填充和边距以及100%宽度的HTML CSS Box?

我有一个#box宽度为100%的盒子,高度:100%,填充:5px,边距:5px; 边界:5px;

我需要在HTML5布局中正确显示它.

现在我有:

在此输入图像描述

但我需要在身体区域适合阻滞.

码:

<!DOCTYPE html>
    <style>
    body,html {
        width: 100%;
        height: 100%;
        margin: 0;
    }

    #box {
        width: 100%;
        height: 100%;
        border: 5px solid red;
        padding: 15px;
        margin: 20px;
    }
    </style>

    <body>
    <div id="box">
    Text will be here
    </div>
    </body>
Run Code Online (Sandbox Code Playgroud)

html css border margin padding

11
推荐指数
1
解决办法
2万
查看次数

如何将 Flutter Chip 小部件的顶部和底部边距设置为零?

如何将 Flutter Chip 小部件的顶部和底部边距设置为零?

所以我可以得到这个

而不是这个

margin widget flutter

11
推荐指数
2
解决办法
1848
查看次数