我Android Navigation bar
在我的项目中使用,我想将动作栏中的顶部颜色更改为红色,我该怎么做?我有这样的事情,
我想要这样的东西,
我怎么能实现这一目标?
android background colors android-actionbar navigation-drawer
我在这个XAML页面上有一个按钮:
<Button Content="Button" HorizontalAlignment="Left" VerticalAlignment="Bottom"
Width="50" Height="50" HorizontalContentAlignment="Left"
BorderBrush="{x:Null}" Foreground="{x:Null}" Margin="50,0,0,0">
<Button.Style>
<Style TargetType="Button">
<Setter Property="Background" Value="Green"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
Run Code Online (Sandbox Code Playgroud)
但是当我将鼠标放在我的按钮上时,按钮的背景会变为默认的窗口灰色背景.
有什么问题?
这是鼠标悬停之前和之后的按钮图片:
之前:
后:
我想使用动态文本作为标签中某些元素的背景.因此,我可以使用图像(动态文本).我怎么用CSS或JavaScript做到这一点?
我目前正在iOS KeyChain中存储用户名(电子邮件)和电子邮件和密码的盐渍哈希.我正在使用这里发现的ARC'ified版本.
KeychainItemWrapper *wrapper = [[KeychainItemWrapper alloc] initWithIdentifier:@"MyCustomIdentifier" accessGroup:nil];
[wrapper setObject:APP_NAME forKey:(__bridge id)kSecAttrService];
[wrapper setObject:email forKey:(__bridge id)kSecAttrAccount];
[wrapper setObject:token forKey:(__bridge id)kSecValueData];
Run Code Online (Sandbox Code Playgroud)
当我需要在应用程序处于活动状态时拉出令牌以进行网络呼叫时,这一切都正常.它适用于从干净的启动登录,以及整个网络调用.当应用程序在后台时,问题就开始了.
请记住,这只是零星发生,我还没有把它固定到特定的iOS版本或设备上.
用户绊倒一个位置(区域监控),我想用他们的状态更新服务器.我尝试将令牌从钥匙串中取出,就像我为每个其他网络呼叫所做的那样,并更新状态.但对于一些用户来说,价值是零.没有它,我无法更新网络内容.为什么这对大多数人有效,但对于一小部分人来说不是这样?
KeychainItemWrapper *wrapper = [[KeychainItemWrapper alloc] initWithIdentifier:@"MyCustomIdentifier" accessGroup:nil];
NSString *token = [wrapper objectForKey:(__bridge id)kSecValueData];
Run Code Online (Sandbox Code Playgroud)
我已经回到了keychainwrapper的非ARC版本,但我仍然得到了相同的结果.我将不胜感激任何反馈.它只是我用户的一小部分,但这是一个我想解决的问题而不用担心.提前致谢.
此外,我的所有后台工作都在backgroundTask中设置,以防止事情超时.我对钥匙链的工作没有任何问题,但在令牌填满之前我不会让事情继续下去.
编辑 我发现我的问题是他们的钥匙串没有从后台检索值.我将在下面发布答案并接受它,因为我觉得这个问题可能会在以后对其他人有价值.
为什么两个堆叠的半透明盒子的最终颜色取决于订单?
我怎么能这样做才能在两种情况下得到相同的颜色?
.a {
background-color: rgba(255, 0, 0, 0.5)
}
.b {
background-color: rgba(0, 0, 255, 0.5)
}
Run Code Online (Sandbox Code Playgroud)
<span class="a"><span class="b"> Color 1</span></span>
<span class="b"><span class="a">Different Color 2</span></span>
Run Code Online (Sandbox Code Playgroud)
我可以layout.xml
使用以下方法设置ImageButton背景透明:
android:background="@android:color/transparent"
Run Code Online (Sandbox Code Playgroud)
我如何使用java代码完成同样的事情?就像是ib.setBackgroundColor(???);
我知道这个问题已经以不同的方式反复提出,但我试图通过所有的答案(希望我没有错过任何人),但没有一个对我有用.
这是我的扩展程序代码:
表现:
{
"name": "test",
"version": "1.1",
"background":
{
"scripts": ["contextMenus.js"]
},
"permissions": ["tabs", "<all_urls>", "contextMenus"],
"content_scripts" : [
{
"matches" : [ "http://*/*" ],
"js": ["jquery-1.8.3.js", "jquery-ui.js"],
"css": [ "jquery-ui.css" ],
"js": ["openDialog.js"]
}
],
"manifest_version": 2
}
Run Code Online (Sandbox Code Playgroud)
contextMenus.js
function onClickHandler(info, tab) {
if (info.menuItemId == "line1"){
alert("You have selected: " + info.selectionText);
chrome.extension.sendMessage({action:'open_dialog_box'}, function(){});
alert("Req sent?");
}
}
chrome.contextMenus.onClicked.addListener(onClickHandler);
chrome.runtime.onInstalled.addListener(function() {
chrome.contextMenus.create({"id": "line1", "type": "normal", "title": "I'm line 1", "contexts":["selection"]});
});
Run Code Online (Sandbox Code Playgroud)
openDialog.js
chrome.extension.onMessage.addListener(function(msg, sender, sendResponse) {
if …
Run Code Online (Sandbox Code Playgroud) background sendmessage google-chrome-extension content-script
让我说我有
<div class="myDiv">Hi there</div>
Run Code Online (Sandbox Code Playgroud)
我想提出一个background-image
并给它一个opacity
的0.5
-但我想,我写的文字将有充分的不透明度(1
).
如果我像这样写CSS
.myDiv { opacity:0.5 }
Run Code Online (Sandbox Code Playgroud)
一切都将是低透明度 - 我不希望这样.
所以我的问题是 - 如何获得具有完全不透明度文本的低不透明度背景图像?
我有一个100%宽度的页脚div.它的高度约为50px,具体取决于其内容.
是否有可能为#footer提供一个溢出这个div的背景图像?
图像大约是800x600px,我希望它位于页脚的左下角.它应该有点像我的网站的背景图像,但我已经在我的身体上设置了背景图像.我需要另一个位于我网站左下角的图像,#footer div对此非常适合.
#footer {
clear: both;
width: 100%;
margin: 0;
padding: 30px 0 0;
background:#eee url(images/bodybgbottomleft.png) no-repeat left bottom fixed;
}
Run Code Online (Sandbox Code Playgroud)
图像设置为页脚,但不会溢出div.是否有可能实现这一目标?
overflow:visible
不做这个工作!
background ×10
css ×4
android ×3
html ×3
image ×2
button ×1
colors ×1
css3 ×1
imagebutton ×1
ios ×1
iphone ×1
keychain ×1
lockscreen ×1
mouseover ×1
overlapping ×1
sendmessage ×1
transparent ×1
triggers ×1
wpf ×1