styles 相关问题

不要使用此标签。此标记目前没有单一的,明确定义的含义。它通常用于代替[css]或与[css]结合使用。它还用于有关用户界面外观和源代码格式问题的问题。

使用hostinger在wordpress上升级CSS时出现问题

基本上我正在做我的第一个互联网作品集。我正在使用 Hostinger 和 wordpress.com。 我想创建自己的主题,所以我在 wpcontet/themes 中创建一个名为 mytheme 的文件夹并放入我的猪圈...

回答 1 投票 0

如何在 Flutter 移动应用程序的 style.xml 中存储的样式之间动态更改

这是我的 styles.xml 文件: <p>这是我的 styles.xml 文件:</p> <pre><code>&lt;resources&gt; &lt;!-- Theme applied to the Android Window while the process is starting when the OS&#39;s Dark Mode setting is off --&gt; &lt;style name=&#34;LaunchTheme&#34; parent=&#34;@android:style/Theme.Light.NoTitleBar&#34;&gt; &lt;!-- Show a splash screen on the activity. Automatically removed when the Flutter engine draws its first frame --&gt; &lt;item name=&#34;android:windowBackground&#34;&gt;@drawable/launch_background&lt;/item&gt; &lt;item name=&#34;android:forceDarkAllowed&#34;&gt;false&lt;/item&gt; &lt;item name=&#34;android:windowFullscreen&#34;&gt;false&lt;/item&gt; &lt;item name=&#34;android:windowDrawsSystemBarBackgrounds&#34;&gt;false&lt;/item&gt; &lt;item name=&#34;android:windowLayoutInDisplayCutoutMode&#34;&gt;shortEdges&lt;/item&gt; &lt;/style&gt; &lt;!-- Theme applied to the Android Window as soon as the process has started. This theme determines the color of the Android Window while your Flutter UI initializes, as well as behind your Flutter UI while its running. This Theme is only used starting with V2 of Flutter&#39;s Android embedding. --&gt; &lt;style name=&#34;NormalTheme&#34; parent=&#34;Theme.MaterialComponents&#34;&gt; &lt;item name=&#34;android:windowBackground&#34;&gt;?android:colorBackground&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p>如何在运行应用程序时在它们之间进行更改? “启动主题”仅用于初始化应用程序,“正常主题”用于其余部分。</p> <p>我发现了一个叫做toggleTheme()的东西,但它对我不起作用</p> </question> <answer tick="false" vote="0"> <p>您想在浅色模式和深色模式等主题之间切换吗? 如果是,请这样做:</p> <p>主题配置.dart:</p> <pre><code>import &#39;package:flutter/material.dart&#39;; import &#39;package:flutter_clock/utils/my_colors.dart&#39;; ThemeData lightTheme = ThemeData.light().copyWith( tabBarTheme: TabBarTheme( indicator: const UnderlineTabIndicator( borderSide: BorderSide(color: MyColors.lightRed, width: 4.0), ), labelColor: Colors.black, unselectedLabelColor: Colors.grey.shade400, unselectedLabelStyle: TextStyle(color: Colors.grey.shade400, fontSize: 10), dividerColor: Colors.transparent, indicatorSize: TabBarIndicatorSize.label, labelStyle: const TextStyle( fontSize: 12, letterSpacing: 1.3, fontWeight: FontWeight.w500), ), primaryColor: const Color(0xFFfafafa), scaffoldBackgroundColor: MyColors.white, floatingActionButtonTheme: const FloatingActionButtonThemeData( backgroundColor: Color(0xFF2b2119), ), ); ThemeData darkTheme = ThemeData.dark().copyWith( tabBarTheme: TabBarTheme( indicator: const UnderlineTabIndicator( borderSide: BorderSide(color: MyColors.lightRed, width: 4.0), ), labelColor: Colors.white, unselectedLabelColor: Colors.grey.shade800, unselectedLabelStyle: TextStyle(color: Colors.grey.shade800, fontSize: 10), dividerColor: Colors.transparent, indicatorSize: TabBarIndicatorSize.label, labelStyle: const TextStyle( fontSize: 12, letterSpacing: 1.3, fontWeight: FontWeight.w500), ), scaffoldBackgroundColor: MyColors.backgroundColor, iconTheme: const IconThemeData(color: Colors.black), primaryColor: Colors.amber); </code></pre> <p>ThemeData darkTheme = ThemeData.dark().copyWith( tabBarTheme: TabBarTheme( 指示器:const UnderlineTabIndicator( borderSide:BorderSide(颜色:MyColors.lightRed,宽度:4.0), ), labelColor:颜色.白色, 未选择的LabelColor:Colors.grey.shade800, 未选择的标签样式: TextStyle(颜色: Colors.grey.shade800, 字体大小: 10), 分隔线颜色:Colors.transparent, IndicatorSize:TabBarIndicatorSize.label, labelStyle: const TextStyle( 字体大小:12,字母间距:1.3,字体粗细:FontWeight.w500), ), 脚手架背景颜色:MyColors.backgroundColor, iconTheme: const IconThemeData(颜色: Colors.black), PrimaryColor:颜色.琥珀色);</p> <p>ThemeData 万圣节主题 = ThemeData.dark().copyWith( tabBarTheme: TabBarTheme( 指示器:const UnderlineTabIndicator( borderSide:BorderSide(颜色:Colors.purple,宽度:4.0), ), labelColor:颜色.白色, 未选择的LabelColor:Colors.grey.shade800, 未选择的标签样式: TextStyle(颜色: Colors.grey.shade800, 字体大小: 10), 分隔线颜色:Colors.transparent, IndicatorSize:TabBarIndicatorSize.label, labelStyle: const TextStyle( 字体大小:12,字母间距:1.3,字体粗细:FontWeight.w500), ), 脚手架背景颜色:MyColors.backgroundColor, iconTheme: const IconThemeData(颜色: Colors.black), PrimaryColor:颜色.琥珀色);</p> <p>然后,在主文件中添加以下内容:</p> <p>main.dart:</p> <pre><code>import &#39;theme_config.dart&#39;; class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: &#39;Flutter Demo&#39;, theme: darkTheme. home: const MyHomePage(title: &#39;Flutter Demo Home Page&#39;), ); } } </code></pre> <p>或者</p> <p>如果您只想要浅色或深色主题,请调用此方法:</p> <pre><code>class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: &#39;Flutter Demo&#39;, theme: ThemeData.dark(), home: const MyHomePage(title: &#39;Flutter Demo Home Page&#39;), ); } } </code></pre> <p>注意: 我有时用<pre><code>MyColors.</code></pre>,你应该用<pre><code>Colors.</code></pre></p> </answer> </body></html>

回答 0 投票 0

更改 Press 事件 React Native 的样式

我在使用onPress事件更改样式时遇到问题,最初我的宽度= 75和高度(宽度和高度的默认值),但是当我使用onPress时我想触发该方法(方法...

回答 4 投票 0

Wordpress 上的按钮对齐

我有一个 WordPress WooCommerce 网站,即使上面的文本有所不同,我也需要将按钮对齐在相同的高度上 我的网站的链接 https://24.sahaap.com/ 我尝试通过CSS代码修复它但是...

回答 1 投票 0

工作区右键菜单的一级和二级菜单的类名是什么?

我想自定义vscode的样式,使用apc扩展。现在我想知道右键菜单的类名。 原因:我知道可以通过workbench中的menu.background来设置。

回答 1 投票 0

无法设置材质-ui 日期选择器确定/取消按钮的样式

我按照此链接中的步骤通过更改主题来更改背景颜色material-ui --> Date Picker 对话框。更改主题改变了背景颜色,但没有改变颜色...

回答 2 投票 0

如何更改放射状条的样式

我想改善我的放射状图形的视觉效果。我使用假数据来模拟来自12个或更多系列/标签后端的数据到达,我的代码如下: 常量图表...

回答 1 投票 0

如何覆盖主题中的 mui 嵌套组件样式?

我创建了一个带有可编辑单元格的 mui DataGrid。在编辑模式下,输入的填充默认为 0 16px,如 mui 生成的样式所示: .css-jqsvr8-MuiInputBase-root-MuiDataGrid-editInp...

回答 2 投票 0

为什么我的 css 没有链接到我的 html 文件?

两个主题化图标的样式都与索引位于同一文件夹中 但是当打开源文件时,themify-icons 不会显示 两个themify图标样式都与index位于同一文件夹中,但是...

回答 1 投票 0

Google 文档:从点到像素的转换是什么?

在 Google Apps 脚本文档中,它多次模糊地引用点,例如此处引用页面的尺寸。快速谷歌搜索发现这种转换取决于...

回答 2 投票 0

我想知道如何正确格式化这些框

目前的情况是这样的: 我想把它做成这样: 我已经尝试更改边框大小、填充和显示类型(当前是内联块),并更改宽度/

回答 1 投票 0

我想知道如何正确格式化这些框

目前就是这样 我想把它做成这样 我已经尝试更改边框大小、填充、显示类型(当前是内联块)并更改宽度/高度...

回答 1 投票 0

这是java中不好的编码风格吗?

我最近在大学进行了一次考试,我实施了这样的课程: 公共类类名{ 私有字符串变量名; //... 公共类名(字符串变量名){ 这个。

回答 1 投票 0

Tailwind CSS 样式不适用

错误发生在哪里? 这是我的终点: 主题: { 屏幕:{ '移动-sm': '320px', '移动MD':'481px', '平板电脑': '769px', '桌面-sm': '1025px', '桌面-md': '1201px' }, 我需要应用...

回答 1 投票 0

MAUI 通过 c# 动态更改样式

当我选择一个元素时,我需要更改它的样式。 资源字典: <Setter Property="StrokeShape" ...</desc> <question vote="0"> <p>当我选择一个元素时,我需要更改它的样式。 资源词典:</p> <pre><code>&lt;Style TargetType=&#34;Border&#34; x:Key=&#34;СBorder&#34;&gt; &lt;Setter Property=&#34;StrokeShape&#34; Value=&#34;RoundRectangle 8&#34; /&gt; &lt;Setter Property=&#34;Stroke&#34; Value=&#34;#D9D9D9&#34;&gt; &lt;/Setter&gt; &lt;Setter Property=&#34;StrokeThickness&#34; Value=&#34;1&#34;&gt;&lt;/Setter&gt; &lt;/Style&gt; &lt;Style TargetType=&#34;Border&#34; x:Key=&#34;SelectBorder&#34;&gt; &lt;Setter Property=&#34;StrokeShape&#34; Value=&#34;RoundRectangle 8&#34; /&gt; &lt;Setter Property=&#34;Stroke&#34; Value=&#34;#9B6CFF&#34;&gt; &lt;/Setter&gt; &lt;Setter Property=&#34;StrokeThickness&#34; Value=&#34;2&#34;&gt;&lt;/Setter&gt; &lt;/Style&gt; </code></pre> <p>Xaml代码:</p> <pre><code>&lt;VerticalStackLayout Spacing=&#34;15&#34; Margin=&#34;0,20,0,0&#34;&gt; &lt;Border Style=&#34;{StaticResource СBorder}&#34; x:Name=&#34;LoginBorder&#34;&gt; &lt;Entry Style=&#34;{StaticResource CEntry}&#34; Placeholder=&#34;E-mail&#34; x:Name=&#34;LoginEntry&#34; Completed=&#34;LoginEntry_Completed&#34; TextChanged=&#34;LoginEntry_TextChanged&#34; &gt;&lt;/Entry&gt; &lt;/Border&gt; &lt;Border Style=&#34;{StaticResource SelectBorder}&#34; x:Name=&#34;PasswordBorder&#34;&gt; &lt;Entry Style=&#34;{StaticResource CEntry}&#34; Placeholder=&#34;Пароль&#34; Completed=&#34;PasswordEntry_Completed&#34; TextChanged=&#34;LoginEntry_TextChanged&#34; x:Name=&#34;PasswordEntry&#34; IsPassword=&#34;True&#34;&gt;&lt;/Entry&gt; &lt;/Border&gt; &lt;Button WidthRequest=&#34;307&#34; HeightRequest=&#34;46&#34; Text=&#34;Вход&#34; Style=&#34;{StaticResource CButton}&#34;&gt; &lt;/Button&gt; &lt;/VerticalStackLayout&gt; </code></pre> <p>我尝试使用<pre><code>LoginBorder.Style = (Style)Application.Current.Resources[&#34;SelectBorder&#34;];</code></pre>,但导致错误<pre><code>System.Collections.Generic.KeyNotFoundException: &#39;The resource &#39;SelectBorder&#39; is not present in the dictionary.&#39;</code></pre>,在网上搜索后,我找不到解决方案。</p> </question> <answer tick="false" vote="0"> <p>您可以使用<a href="https://learn.microsoft.com/en-us/dotnet/maui/user-interface/visual-states?view=net-maui-8.0" rel="nofollow noreferrer">视觉状态</a>:</p> <pre><code>&lt;VerticalStackLayout Margin=&#34;0,20,0,0&#34; Spacing=&#34;15&#34;&gt; &lt;Border x:Name=&#34;LoginBorder&#34;&gt; &lt;VisualStateManager.VisualStateGroups&gt; &lt;VisualStateGroupList&gt; &lt;VisualStateGroup Name=&#34;CommonStates&#34;&gt; &lt;VisualState Name=&#34;Normal&#34;&gt; &lt;VisualState.Setters&gt; &lt;Setter Property=&#34;StrokeShape&#34; Value=&#34;RoundRectangle 8&#34; /&gt; &lt;Setter Property=&#34;Stroke&#34; Value=&#34;#D9D9D9&#34; /&gt; &lt;Setter Property=&#34;StrokeThickness&#34; Value=&#34;1&#34; /&gt; &lt;/VisualState.Setters&gt; &lt;/VisualState&gt; &lt;VisualState Name=&#34;Focused&#34;&gt; &lt;VisualState.Setters&gt; &lt;Setter Property=&#34;StrokeShape&#34; Value=&#34;RoundRectangle 8&#34; /&gt; &lt;Setter Property=&#34;Stroke&#34; Value=&#34;#9B6CFF&#34; /&gt; &lt;Setter Property=&#34;StrokeThickness&#34; Value=&#34;2&#34; /&gt; &lt;/VisualState.Setters&gt; &lt;/VisualState&gt; &lt;VisualState Name=&#34;Disabled&#34;&gt; &lt;VisualState.Setters&gt; &lt;Setter Property=&#34;BackgroundColor&#34; Value=&#34;DarkGray&#34; /&gt; &lt;/VisualState.Setters&gt; &lt;/VisualState&gt; &lt;VisualState Name=&#34;PointerOver&#34;&gt; &lt;VisualState.Setters&gt; &lt;Setter Property=&#34;BackgroundColor&#34; Value=&#34;LightBlue&#34; /&gt; &lt;/VisualState.Setters&gt; &lt;/VisualState&gt; &lt;/VisualStateGroup&gt; &lt;VisualStateGroupList&gt; &lt;/VisualStateManager.VisualStateGroups&gt; &lt;Entry x:Name=&#34;LoginEntry&#34; Placeholder=&#34;E-mail&#34; /&gt; &lt;/Border&gt; &lt;Border x:Name=&#34;PasswordBorder&#34;&gt; &lt;Entry x:Name=&#34;PasswordEntry&#34; IsPassword=&#34;True&#34; Placeholder=&#34;Пароль&#34; /&gt; &lt;/Border&gt; &lt;Button HeightRequest=&#34;46&#34; Text=&#34;Вход&#34; WidthRequest=&#34;307&#34; /&gt; &lt;/VerticalStackLayout&gt; </code></pre> </answer> </body></html>

回答 0 投票 0

如何复制word文档的内容?

我想编写一个程序,从Word文档复制文本并将其粘贴到另一个文档。我正在尝试使用 python-docx 库来做到这一点。我可以使用以下代码做到这一点,但是......

回答 2 投票 0

在 flutter 中自动设置文本样式

我使用了 Gemini AI 的 API,该 AI 向我发送了一条带有星号和标签的文本,用于格式化文本,如下所示: **知识和信息:** **回答问题:**提供事实信息并了解...

回答 1 投票 0

如何在部分html代码中不使用body样式css规则?

我有这个正文样式CSS规则。我想知道如何保留该规则,但只是不将其用于在 之后立即开始的代码部分?之后立即开始的代码...

回答 3 投票 0

如果输入字段为空,仅使用 CSS 如何应用样式?

我目前正在开发一个接受文本输入的表单。但是,在输入有效的电子邮件地址之前,我实现的功能对于电子邮件输入无法正常工作。此外,...

回答 1 投票 0

在 WPF XAML 中禁用样式?

有没有办法以编程方式关闭样式? 例如,我有一个链接到所有文本框的样式 我想添加一些代码到 ac...</desc> <question vote="33"> <p>有没有办法以编程方式关闭样式?</p> <p>举个例子,我有一个链接到所有文本框的样式</p> <pre><code>&lt;Style TargetType=&#34;{x:Type TextBox}&#34;&gt; </code></pre> <p>我想添加一些代码来实际停止使用样式元素,因此基本上恢复到默认的控件样式。</p> <p>我需要一种方法来切换我的样式,这样我就可以通过 C# 代码在 Windows 默认样式和我的自定义样式之间切换。</p> <p>有办法做到这一点吗?</p> <p>谢谢</p> <p><strong>工作解决方案</strong></p> <p><a href="http://sa.ndeep.me/post/switching-between-themes-in-wpf" rel="noreferrer">在 WPF 中切换主题</a></p> </question> <answer tick="true" vote="79"> <p>要将样式设置为默认,</p> <p>在 XAML 使用中,</p> <pre><code>&lt;TextBox Style=&#34;{x:Null}&#34; /&gt; </code></pre> <p>在C#中使用,</p> <pre><code>myTextBox.Style = null; </code></pre> <hr/> <p>如果多个资源的样式需要设置为null,请参阅<strong>CodeNaked的</strong>响应。</p> <hr/> <p>在代码背后,我认为这就是您想要实现的目标:</p> <pre><code>Style myStyle = (Style)Application.Current.Resources[&#34;myStyleName&#34;]; public void SetDefaultStyle() { if(Application.Current.Resources.Contains(typeof(TextBox))) Application.Current.Resources.Remove(typeof(TextBox)); Application.Current.Resources.Add(typeof(TextBox), new Style() { TargetType = typeof(TextBox) }); } public void SetCustomStyle() { if (Application.Current.Resources.Contains(typeof(TextBox))) Application.Current.Resources.Remove(typeof(TextBox)); Application.Current.Resources.Add(typeof(TextBox), myStyle); } </code></pre> </answer> <answer tick="false" vote="23"> <p>您可以注入一个空白样式,该样式优先于其他样式。像这样:</p> <pre><code>&lt;Window&gt; &lt;Window.Resources&gt; &lt;Style TargetType=&#34;TextBox&#34;&gt; &lt;Setter Property=&#34;Background&#34; Value=&#34;Red&#34; /&gt; &lt;/Style&gt; &lt;/Window.Resources&gt; &lt;Grid&gt; &lt;Grid.Resources&gt; &lt;Style TargetType=&#34;TextBox&#34; /&gt; &lt;/Grid.Resources&gt; &lt;/Grid&gt; &lt;/Window&gt; </code></pre> <p>在上面的示例中,只有网格的隐式样式会应用于网格中的文本框。您甚至可以通过编程方式将其添加到网格中,例如:</p> <pre><code>this.grid.Resources.Add(typeof(TextBox), new Style() { TargetType = typeof(TextBox) }); </code></pre> </answer> <answer tick="false" vote="3"> <p>我知道答案已被接受,但我想添加我的解决方案,该解决方案在以下情况下效果很好:</p> <ul> <li>使用 mahapps.metro 的一个主要应用程序</li> <li>从主应用程序导入的附加项目没有引用 mahapps.metro,它作为插件导入(动态加载编译的 .dll)</li> <li>使用 < ToolBar> 将所有内容重新设置为 null,因此 mahapps.metro 样式不会应用于工具栏中的项目。</li> <li>usercontrol 用于为主应用程序提供自定义控件。</li> </ul> <p>在用户控制根目录中设置资源:</p> <pre><code>&lt;UserControl.Resources&gt; &lt;Style x:Key=&#34;ButtonStyle&#34; TargetType=&#34;Button&#34; BasedOn=&#34;{StaticResource {x:Type Button}}&#34; /&gt; &lt;Style x:Key=&#34;ComboBoxStyle&#34; TargetType=&#34;ComboBox&#34; BasedOn=&#34;{StaticResource {x:Type ComboBox}}&#34; /&gt; &lt;/UserControl.Resources&gt; </code></pre> <p>那么工具栏代码可以如下</p> <pre><code> &lt;ToolBar&gt; Block Template: &lt;ComboBox Style=&#34;{StaticResource ComboBoxStyle}&#34;/&gt; &lt;Button Content=&#34;Generate!&#34; Style=&#34;{StaticResource ButtonStyle}&#34;/&gt; &lt;/ToolBar&gt; </code></pre> <p>这成功地将主应用程序样式应用到 < ToolBar></p> 内的控件 </answer> <answer tick="false" vote="1"> <p>在 Xaml 中,您可以通过显式设置样式来覆盖它。在代码隐藏中,您还可以显式设置样式。</p> <pre><code>&lt;TextBox Style=&#34;{StaticResource SomeOtherStyle}&#34;/&gt; myTextBox.Style = Application.Resources[&#34;SomeOtherStyle&#34;]; </code></pre> </answer> </body></html>

回答 0 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.