标签: background

如何使用swift在Xcode中设置背景图像?

如何使用swift为Xcode 6中的主视图控制器设置背景图像?我知道您可以在助理编辑器中执行此操作,如下所示:

override func viewDidLoad() {
    super.viewDidLoad()
    view.backgroundColor = UIColor.yellowColor()
}
Run Code Online (Sandbox Code Playgroud)

将背景设置为我的资产文件夹中的图像的代码是什么?

background ios swift

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

当使用鼠标滚轮滚动时,IE 10和11使固定背景跳跃

在Windows 8中使用鼠标滚轮滚动时,固定的背景图像会像疯了一样反弹.这仅影响IE 10和IE 11.这position:fixed也会影响元素.在IE 10和11中有没有阻止它发生?

这是一个固定背景图像的示例:

http://www.catcubed.com/test/bg-img-fixed.html

css internet-explorer background image fixed

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

透明的iframe身体

我需要一个具有动态宽度和高度的(crossdomain)iframe.

我的问题是,我可以创建一个100%大小的iframe和一个透明背景,它将在其后面显示这个iframe的父级吗?

我可以为iframe背景附加css属性或透明gif来实现这种效果吗?

谢谢.

css iframe background transparent

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

iPhone - 在UITableViewController上设置背景

有没有办法在UITableViewController上设置背景视图?

我尝试使用我正在使用的代码UIViewController,但视图覆盖​​了表视图的所有内容.如果我在其中添加背景视图cellForRowAtIndexPath-method,则根本不显示.有没有人以前做过这个或者知道如何做到这一点?这是我正在使用的代码:

UIImage *image = [UIImage imageNamed: @"background.jpg"];
UIImageView *backImage = [[UIImageView alloc] initWithImage: image];
[self.view addSubview: backImage];
[self.view sendSubviewToBack: backImage];
Run Code Online (Sandbox Code Playgroud)

iphone background uitableview

50
推荐指数
4
解决办法
5万
查看次数

设置CGContext透明背景

我仍然在努力用CGContext绘制一条线.我实际上去绘制线条,但现在我需要将Rect的背景透明,以便现有的背景显示出来.这是我的测试代码:

(void)drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
    CGContextSetAlpha(context,0.0);
    CGContextFillRect(context, rect);

    CGContextSetStrokeColorWithColor(context, [UIColor whiteColor].CGColor);
    CGContextSetLineWidth(context, 5.0);
    CGContextMoveToPoint(context, 100.0,0.0);
    CGContextAddLineToPoint(context,100.0, 100.0);
    CGContextStrokePath(context);
}
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

iphone graphics background transparent cgcontext

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

用rgba背景颜色叠加背景图像

我有div一个background-image.rgba(0,0,0,0.1)当用户悬停div时,我想用rgba颜色()覆盖背景图像.

我想知道是否有一个div解决方案(即没有多个div,一个用于图像,一个用于颜色等).

我尝试过多种方法:

<div class="the-div" id="test-1"></div>
<div class="the-div" id="test-2"></div>
<div class="the-div" id="test-3"></div>
Run Code Online (Sandbox Code Playgroud)

这个CSS:

.the-div {
    background-image: url('the-image');
    margin: 10px;
    width: 200px;
    height: 80px;
}

#test-1:hover {
    background-color: rgba(0,0,0,0.1);
}

#test-2:hover {
    background: url('the-image'), rgba(0,0,0,0.1);
}

#test-3:hover {
    background: rgba(0,0,0,0.1);
}
Run Code Online (Sandbox Code Playgroud)

看到这个小提琴.

我看到的唯一选择是制作另一个图像,使用叠加,使用JavaScript预加载然后使用.the-div:hover { background: url('the-new-image'); }.但是,我想要一个仅限CSS的解决方案(更整洁;更少的HTTP请求;更少的硬盘).有没有?

css background background-image css3 rgba

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

Internet Explorer中的渐变颜色

我知道Internet Explorer有一些专有扩展,因此您可以执行创建具有渐变背景的div的操作.我记不起元素名称或它的用法.有没有人有一些例子或链接?

html css internet-explorer gradient background

49
推荐指数
5
解决办法
9万
查看次数

更改所选单元格的背景颜色?

有没有人知道如何使用UITableViewCell为每个选定的单元格更改单元格的背景颜色?我在TableView的代码中创建了这个UITableViewCell.

iphone background colors uitableview tableview

49
推荐指数
13
解决办法
10万
查看次数

如何在右下角定位背景图像?(CSS)

我有一个500x500像素的图像,在我的网站上设置为背景图像(作为背景图像<body>)但我需要这个图像位于网页的右下角.我怎样才能做到这一点?(用css方法更好)

谢谢.

css background

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

Android形状背景

是否可以在xml中绘制一个形状,并使用png作为该形状的背景?我已经有了形状(它是一个带圆角的正方形),我想把背景放到那个正方形上.

android background shape

48
推荐指数
1
解决办法
5万
查看次数