我正在使用android studio中的mediaplayer类.我只想淡出一个声音并淡化另一个声音,而不是使用setVolume(0,0)和setVolume(1,1).
我为此创建了两个媒体播放器,似乎我在这个帖子中找到了一个解决方案:Android:如何为我的应用播放的任何音乐文件创建淡入/淡出音效?但我不知道如何使用deltaTime.
还有其他一些解决方案,我几乎无法理解.难道没有一种简单的方法来淡化两个媒体播放器,我无法想象还没有人需要这个或者每个人都使用强迫性代码来实现它.我该如何使用deltaTime?
我用 flex box 创建了一个有点圣杯的布局。这完全像它应该没有任何滚动条一样工作 - 直到我将 Quill 文本编辑器插入到我的 content_wrapper 容器中。在此容器中,有顶部工具栏和内部编辑器的主 div。
当我尝试将编辑器的高度设置为 100% 时,它会产生溢出(我认为是因为它占据了主体的 100%,但没有意识到它上面还有我的自定义蓝色工具栏)。
我需要如何设置我的页面,使编辑器不会在底部的页面之外?
请在完整视图页面上运行此代码片段!
html,body {
height:100%;
margin: 0;
padding: 0;
}
.main_wrapper {
background-color: white;
display: flex;
min-height: 100vh;
flex-direction: row;
}
.content_wrapper {
flex: 1;
display: flex;
flex-direction: column;
}
aside.sidebar {
background-color: grey;
flex: 0 0 195px;
}
header.topbar {
background-color: blue;
flex: 0 0 50px;
}
main {
background-color: white;
flex: 1;
}
.contentbar {
background-color: grey;
flex: 0 0 405px; …Run Code Online (Sandbox Code Playgroud)我正在尝试在标签中添加一个类,在我的力图中单击了该类.为此,我使用"单击"功能,将单击的项目交给更新功能(它更新项目的类).我尝试使用它,但控制台将报告" nodeClicked.childNodes [1] .classed不是一个函数 ".
然后我用Google搜索并尝试使用" d3.select(this).select("text"); "这不报告错误,也不更新文本.
一个节点是一个<g>元素,它有两个子节点:一个圆圈和一个文本(我要给css类的文本)
如果你愿意,你可以查看我的代码片段:
// Toggle children on click.
// Also save information about what was clicked and update the GUI
function click(d) {
if (d.children) {
d._children = d.children;
d.children = null;
}
else{
d.children = d._children;
d._children = null;
}
// Save which node was just clicked now
nodeClicked = d3.select(this).select("text");
// Save the d3 data of this node
nodeClickedData = d;
}
Run Code Online (Sandbox Code Playgroud)
要改变我测试的类:
$(nodeClicked).addClass("nodeGreenMarked");
Run Code Online (Sandbox Code Playgroud)
和:
nodeClicked.classed("nodeBlueMarked", true); …Run Code Online (Sandbox Code Playgroud) android ×1
audio ×1
css ×1
d3.js ×1
flexbox ×1
javascript ×1
jquery ×1
media-player ×1
quill ×1
timedelta ×1