Tag: 间距

如何更改UILabel / UIFont的字母间距?

我已经search到负载,找不到答案。 我有一个正常的UILabel,这样定义: UILabel *totalColors = [[[UILabel alloc] initWithFrame:CGRectMake(5, 7, 120, 69)] autorelease]; totalColors.text = [NSString stringWithFormat:@"%d", total]; totalColors.font = [UIFont fontWithName:@"Arial-BoldMT" size:60]; totalColors.textColor = [UIColor colorWithRed:221/255.0 green:221/255.0 blue:221/255.0 alpha:1.0]; totalColors.backgroundColor = [UIColor clearColor]; [self addSubview:totalColors]; 而且我希望字母之间的水平间距更紧,同时保持字体的大小。 有没有办法做到这一点? 这应该是一个非常基本的事情。 干杯,安德烈 更新: 所以我被迫这样做: – (void) drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSelectFont (context, "Arial-BoldMT", 60, kCGEncodingMacRoman); CGContextSetCharacterSpacing […]

thead和tbody之间的间距

我有这样一个简单的HTML表格: <table> <thead> <tr><th>Column 1</th><th>Column 2</th></tr> </thead> <tbody> <tr class="odd first-row"><td>Value 1</td><td>Value 2</td></tr> <tr class="even"><td>Value 3</td><td>Value 4</td></tr> <tr class="odd"><td>Value 5</td><td>Value 6</td></tr> <tr class="even last-row"><td>Value 7</td><td>Value 8</td></tr> </tbody> </table> 我想用下面的方式来devise它: 标题行与框阴影 标题行和第一个正文行之间的空格 我尝试了不同的东西: table { /* collapsed, because the bottom shadow on thead tr is hidden otherwise */ border-collapse: collapse; } /* Shadow on the header […]

在div中居中文字?

我有一个30px高和宽500px的div 。 这个div可以包含两行文本,并相应地进行样式化(填充)。 但是有时它只包含一行,我希望它是居中。 这可能吗?

Flexbox项目之间的间距

这就是我要的: 我得到的最近 在Flexbox项目上应用边距,然后从第一个和最后一个子项中删除一半。 问题是:first-child并不总是第一个可见的,因为我可能会改变布局的顺序( 例子 )。 在应用边距时,有没有办法将视觉顺序考虑在内?

Android:TextView:删除顶部和底部的间距和填充

当我在文本中有\n的TextView ,右侧有两个singleLine ,一个在另一个下面,两者之间没有间距。 我为所有三个TextView设置了以下内容。 android:lineSpacingMultiplier="1" android:lineSpacingExtra="0pt" android:paddingTop="0pt" android:paddingBottom="0pt" 左边的TextView的第一行与右上方的TextView完全TextView 。 左侧TextView的第二行比右下angularTextView的第二行稍高。 似乎在TextView的顶部和底部有一些隐藏的填充。 我怎样才能删除?

在Firefox中删除额外的button间距/填充

看到这个代码示例: http : //jsfiddle.net/Z2BMK/ Chrome / IE8看起来像这样 Firefox看起来像这样 我的CSS是 button { padding:0; background:#080; color:white; border:solid 2px; border-color: #0c0 #030 #030 #0c0; margin:0; } 如何更改代码示例使两个浏览器中的button相同? 我不想使用基于JavaScript的超链接,因为它们不适用于键盘上的空格键,它必须有一个href URL,这不是一个干净的方式来处理事情。 我的解决scheme,自Firefox 13 button::-moz-focus-inner { margin: -1px; padding: 0; border-width: 1px; }

在容器视图中均匀地分隔多个视图

自动布局正在使我的生活困难。 从理论上讲,当我转换的时候它会非常有用,但是我似乎一直在争取。 我做了一个演示项目,试图find帮助。 有没有人知道如何使视图之间的空间平均增加或减less每当视图resize? 这里有三个标签(手动间隔垂直): 我想要的是他们调整他们的间距(而不是视图大小)均匀旋转。 默认情况下,顶部和底部视图朝中心方向挤压: