如何播放背景音乐并使其循环播放?
目前我正在使用这段代码来播放背景音乐:
XNA-C#
SoundEffect bgEffect;
bgEffect = Content.Load<SoundEffect>("EpicUnease");
bgEffect.Play(0.1f, 0.0f, 0.0f);
Run Code Online (Sandbox Code Playgroud) 当iphone处于睡眠模式并且我的应用程序尝试执行http请求时,不会调用委托方法.当iphone处于睡眠模式或按下主页按钮时,如何执行NSURLConnection?
表格行有悬停背景.我需要在背景上得到圆角.
table tbody tr#ClickableRow:hover {
background-color: #fbf6e7;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
border-radius: 20px;
cursor: pointer;
}
Run Code Online (Sandbox Code Playgroud)
<tr id="ClickableRow">
<td>
<a href="http://somesite.com">Go Here</a>
<p>To find about all the interestng animals found in this tourist attractions including zebra, giraffe..... ....
</p>
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
这不起作用.我仍然得到平方的bg.
我有一个带编号针脚的谷歌地图.地图上的针脚为红色.页面中的实际地址应该有灰色标记.我正在尝试将background属性用于地址元素"LocationName",其中包含附加灰色标记图像背景的地址(不重复左中心).图像命名为greymarker1,greymarker2等.所以如果它是第一个地址,greymarker1.png应该是地址ONE前面的图标.我可以使用jQuery设置背景的CSS属性,但我不知道如何使URL动态.."/样式库/图片/设计/图标/ greymarker1.png")1中的网址应以柜台改变..当counter等于1时,它应该抓住greymarker1.png等.
$('.LocationName').each(function(index){
var counter=index+1;
//$(this).css('color', 'blue');
$(this).css("background-image", "url('/Style Library/Images/design/icons/greymarker1.png')");
});
Run Code Online (Sandbox Code Playgroud) 我环顾四周寻找答案,对我来说没什么用.我希望能够单击一个div并更改背景,然后在下一次单击div时我希望它再次更改.第一部分有效,但我无法弄清楚如何做第二部分.
这是有效的(使用jQuery):
$(document).ready(function(){
$('.button').click(function() {
$('.icon').css("background-position", "0px 0px");
});
});
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激,谢谢.
在我的应用程序中,我使用了许多对话框(弹出窗口),我想给它们一个圆角形状.
我创建这些弹出窗口的方式是这样的:
在java代码上我创建一个这样的函数:
private void showpopup(){
dialog = new Dialog(this);
dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(getLayoutInflater().inflate(R.layout.popup, null));
dialog.setCancelable(false);
TextView fin = (TextView) dialog.findViewById(R.id.solu);
fin.setText("¡¡safsfasfsafs!!");
fin.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
Run Code Online (Sandbox Code Playgroud)
我在那里调用的布局是以这种方式创建的:
<?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"
android:layout_height="fill_parent"
android:gravity="center"
>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape"
android:orientation="vertical"
android:padding="10dp"
>
<TextView
android:id="@+id/solu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25sp"
android:padding="10dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
最后,我在后台调用的xml"形状"是这样的:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners android:radius="20dp"/>
<stroke
android:width="1dp"
android:color="@color/black"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
结果是这样的:
如你所见,我没有实现我想要的......
所以我目前正在创建一个登录屏幕,它具有使用Graphics对象和"游戏循环"制作的酷炫背景效果.当我添加一个JTextField
虽然,它被看到在一切,而不是在上面.无论如何要在图形内部的所有组件下绘制JFrame
?
这是图形的图像:
文本字段就在那里,就在绘制到框架表面的所有内容之下.我想以某种方式重新排序,以便它在组件下面绘制.
这是我目前的框架代码:
frame = new JFrame("Login");
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.getContentPane().setPreferredSize(new Dimension(450, 200));
frame.getContentPane().setBackground(Color.black);
frame.setBackground(Color.black);
frame.setLayout(new FlowLayout());
JTextField user = new JTextField(20);
user.setLocation(100, 200);
user.setVisible(true);
frame.add(user);
frame.pack();
frame.setVisible(true);
frame.createBufferStrategy(2);
buff = frame.getBufferStrategy();
Painter painter = new Painter();
frame.add(painter);
Run Code Online (Sandbox Code Playgroud)
有什么帮助吗?
我必须以特定的间隔更改背景图像.背景中将有大约4-5张图像将被更改.此外,我希望有一个很好的过渡效果,其中一个图像开始褪色,甚至在它完全褪色之前,下一个图像开始淡入.
有关所需功能,请访问http://www.virgin-atlantic.com/gb/en.html
结构是我有如下:
<div class="items">
<div id="backWallpaper" style="left: 0px; top: 0px; overflow: hidden; position: absolute;
z-index: -1; margin: 0px; padding: 0px; display: none;" class="carousel_item">
<img class="bg_slider" src="images/bg_img_01.jpg" alt="Get the most out of your Trade In">
</div>
<div id="backWallpaper" style="left: 0px; top: 0px; overflow: hidden; position: absolute;
z-index: -1; margin: 0px; padding: 0px; display: none;" class="carousel_item">
<img class="bg_slider" src="images/bg_img_02.jpg" alt="Get the most out of your Trade In">
</div>
<div id="backWallpaper" style="left: 0px; top: 0px; overflow: hidden; position: absolute;
z-index: -1; …
Run Code Online (Sandbox Code Playgroud) 我的应用程序在不同的屏幕中显示分组的静态UITableViews.无论如何使用外观代理
[UITableView appearance]
Run Code Online (Sandbox Code Playgroud)
要么
[UITableViewCell appearance]
Run Code Online (Sandbox Code Playgroud)
自定义所选单元格的背景颜色?基本上我需要修改
cell.selectedBackgroundView.backgroundColor
Run Code Online (Sandbox Code Playgroud)
对于我的应用程序中的每个单元格,但我找不到在代理对象中设置的正确属性.
顺便说一下,我也试过了正常的方法(作为一个组静态表):
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.selectedBackgroundView.backgroundColor = [UIColor yellowColor];
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用.有什么建议吗?
不知道发生了什么,但由于某种原因,在外部样式表中链接时我的背景图像没有显示.
例1 :(工作)
<html>
<head>
...
</head>
<body style="background: url(images/image.jpg);">
...
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
例2 :(非工作 - 外部css文件)
body {
background: url(images/image.jpg);
}
Run Code Online (Sandbox Code Playgroud)
当/如果我使用第一个示例时,将显示图像,但是当我使用第二个示例时,不会显示图像.
有什么建议?先谢谢你...
background ×10
css ×5
jquery ×4
android ×1
animation ×1
c# ×1
dialog ×1
image ×1
ios ×1
ios5.1 ×1
iphone ×1
java ×1
javascript ×1
jtextfield ×1
loops ×1
objective-c ×1
playback ×1
swing ×1
uiappearance ×1
uitableview ×1
url ×1