我的 WPF 应用程序有一个自定义 WindowChrome 样式(从此处摘取: http: //www.bdevuyst.com/wpf-custom-title-bar-and-taskbar/)。
代码在这里:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity">
<!-- Simple style without anything to remove the title bar -->
<Style x:Key="Style.Window.WindowStyleNoneWithTaskbar.Base" TargetType="{x:Type Window}">
<Setter Property="shell:WindowChrome.WindowChrome" >
<Setter.Value>
<shell:WindowChrome GlassFrameThickness="0" />
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Window}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding Foreground}" BorderThickness="1" >
<ContentPresenter Content="{TemplateBinding Content}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Simple style with system buttons upper right -->
<Style TargetType="{x:Type Window}" BasedOn="{StaticResource Style.Window.WindowStyleNoneWithTaskbar.Base}" x:Key="Style.Window.WindowStyleNoneWithTaskbar">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Window}"> …Run Code Online (Sandbox Code Playgroud) 我的工具栏上有两个按钮,它们不遵守“wrap_content”layout_width 指令。我添加了绿色和红色背景颜色,以使它们的真实宽度在屏幕截图中清晰可见。我将内边距设置为 0dp 并且没有边距。我查看了我的简短 styles.xml,没有看到任何相关内容,而且我没有注意到应用程序中的其他任何地方正在发生这种情况。任何提示将不胜感激。
谢谢。
<android.support.v7.widget.Toolbar
android:id="@+id/pdf_renderer_toolbar"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/primaryColor"
android:theme="@style/MyStyle"
app:layout_scrollFlags="scroll|enterAlways"
app:titleTextAppearance="@style/Toolbar.TitleText"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" >
<Button
android:layout_width="wrap_content"
android:layout_height="50dp"
android:text="Docs"
android:layout_gravity="right"
android:layout_marginRight="0dp"
android:padding="0dp"
android:background="@color/green_button_color"
android:textColor="@color/solid_white"
android:textSize="18sp"
android:id="@+id/pdf_docs_button"
android:textAllCaps="false"
style="?android:attr/borderlessButtonStyle"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="50dp"
android:text="Edit"
android:layout_gravity="right"
android:padding="0dp"
android:layout_marginRight="0dp"
android:background="@color/red_button_color"
android:textColor="@color/solid_white"
android:textSize="18sp"
android:id="@+id/pdf_edit_button"
android:textAllCaps="false"
style="?android:attr/borderlessButtonStyle"
/>
</android.support.v7.widget.Toolbar>
Run Code Online (Sandbox Code Playgroud) 给定一个带有屏幕文本标签和按钮的应用程序。每次按下按钮时,文本都会发生变化。我希望能够按下按钮,并且在更改文本时文本将“闪烁”,以使文本更改对用户来说更加明显。
给定以下变量:
@IBOutlet weak var text: UILabel!
@IBAction func buttons(_ sender: UIButton) {}
Run Code Online (Sandbox Code Playgroud)
我尝试过 SKAction、淡入/淡出,但所有教程/帮助都是旧版本的 Swift 中的,对我不起作用。
我想使用下面的按钮打开文件对话框来选择一个/多个单词文件。我还希望它像一个返回路径的方法,以便我可以读取/加载该数据。
<div>
<div class="col-lg-6 col-md-6 col-sm-6">
<img class="img-analyse" src="~/Content/open-file_icon.png">
<button class="button-analyse"onclick="SelectFile">b</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我该如何继续?我要注册一个动作事件吗?抱歉,我是 ASP.NET 的初学者。
@media (min-width: 320px) {
}
@media (min-width: 576px) {
}
@media (min-width: 768px) {
}
@media (min-width: 992px) {
}
@media (min-width: 1200px) {
}Run Code Online (Sandbox Code Playgroud)
<div class="container">
<div class="row">
<div class="col-lg-24 col-centered">
<div class="btn-group flex-wrap">
<a href="neckandears.html" class="btn btn-info" role="button">Necklace and Earring sets</a>
<a href="necklaces.html" class="btn btn-info" role="button">Necklaces</a>
<a href="bracelets.html" class="btn btn-info" role="button">Bracelets</a>
<a href="earrings.html" class="btn btn-info" role="button">Earrings</a>
<a href="gemstones.html" class="btn btn-info" role="button">Gemstones</a>
</div>
</div>
</div>Run Code Online (Sandbox Code Playgroud)
除了我拥有的按钮栏之外,我创建的所有网站都是响应式的。HTML 已包含在内。当屏幕尺寸变为移动设备时,我希望按钮栏成为下拉菜单,以期缓解此问题。截至目前,尽管我确实有媒体查询,但我的 CSS 仅更改边框和按钮内部的颜色。我的导航栏下方的按钮栏中有 5 个按钮,当屏幕尺寸小于桌面尺寸时,我希望它是一个下拉菜单而不是按钮组。我目前正在使用柔性包装,但按钮在移动视图中只是堆叠在一起。我无法找到一种方法使按钮组本身具有响应性并像网站的其他部分一样缩小尺寸。这是我第一次使用 HTML 或 CSS。感谢您的帮助!
我已经编写了程序,一旦关卡完成,就会弹出一个面板并附加这个按钮。然而这个按钮不起作用。
我已经 - 检查了我的事件系统,检查了光线投射设置,设置了 onclick 事件,还将按钮放在 z 轴上,这样它就不会受到面板的干扰。
我的层次结构
按钮的检查器
画布检查员
我有一个以 png 图像作为背景的按钮,我想为其文本添加阴影。
我尝试将此代码添加到 Activity_main.xml 中的按钮代码中:
android:shadowDy="20"
android:shadowDx="20"
android:shadowColor="#000"
android:shadowRadius="10"
Run Code Online (Sandbox Code Playgroud)
但不起作用。
Activity_mani.xml
<Button
android:id="@+id/btnMarket"
style="@style/ButtonTheme"
fontPath="bkoodak.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:text="@string/btnMarket"
android:textSize="40sp" />
Run Code Online (Sandbox Code Playgroud)
样式.xml
<style name="ButtonTheme" parent="@android:style/Widget.Button">
<item name="android:layout_width">fill_parent</item>
<item name="android:textColor">#fff</item>
<item name="android:textSize">15sp</item>
<item name="android:padding">10dp</item>
<item name="android:textStyle">bold</item>
<item name="android:background">@drawable/btnbackground</item>
<item name="android:gravity">center</item>
<item name="android:layout_margin">3dp</item>
</style>
Run Code Online (Sandbox Code Playgroud)
是否可以为按钮的文本添加阴影?
import React from "react";
checkClick = () => {
console.log("clicked");
};
class Test extends React.Component {
render() {
return (
<div>
<button id="button" onClick={this.checkClick}>
click
</button>
</div>
);
}
}
export default Test;
Run Code Online (Sandbox Code Playgroud)
如何在用户访问页面时自动点击按钮?
这里我想自动点击上面的按钮。
我尝试过:
document.getElementById("button").click()
这是行不通的。
我的文件夹中有一个 SVG icon.svg,我试图将它与文本一起渲染在按钮中。具体来说,它是 Google 图标,我试图将其呈现在一些显示“使用 GOOGLE 登录”的文本旁边
我按原样导入 SVG 并尝试将其传递到按钮旁边,但是文件路径正在呈现:
function App() {
return (
<div className="App">
<button>{SVG}SIGN IN WITH GOOGLE</button>
</div>
);
}
Run Code Online (Sandbox Code Playgroud)
这会呈现一个按钮,上面写着/static/media/Icon.a1611096.svgSIGN IN WITH GOOGLE
如何正确渲染按钮内的图标?
编辑:我一直在弄乱图标和按钮并接近:
如果您单击该图像(位于按钮内),则会弹出一条 Alertify 消息。当消息关闭时会发生这种情况(上图)。
我遇到这个问题,其中按钮默认返回默认按钮装饰。我该如何防止这种情况发生?我已经尝试过outline: none !importantCSS 元素,但它仍然不起作用。有没有一种“积极”的方法来摆脱这个问题?
编辑:我已经仔细检查了开发人员工具,似乎outlineCSS 代码已经应用。然而,这个问题仍然存在。
button ×10
c# ×3
android ×2
html ×2
reactjs ×2
asp.net-mvc ×1
blink ×1
bootstrap-4 ×1
buttonclick ×1
click ×1
colors ×1
css ×1
dropdown ×1
icons ×1
ios ×1
java ×1
javascript ×1
responsive ×1
swift ×1
text ×1
titlebar ×1
toolbar ×1
wpf ×1
xaml ×1