- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个母版页,我有一个来自这个母版页的内容页。我必须只为这个内容页使用不同的 css 作为 body 标签吗?我该怎么做?
这是我的母版页的CSS
body, div, ul, ol, li, p, h1, h2, h3, span, pre, a, img, blockquote, table, tbody, tfoot, thead, tr, th, td, pre, code {
margin:0px; padding:0px; border:0 none; outline:0; vertical-align:baseline;}
我不想为我的内容页面使用此 css 代码。我该怎么做?
最佳答案
您可以在包含 CSS 的母版页中创建一个控件。如:
<%@ Master Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server" >
<title>Master page title</title>
</head>
<asp:contentplaceholder id="CSS" runat="server">
<style type="text/css">
body, div, ul, ol, li, p, h1, h2, h3, span, pre, a, img, blockquote, table, tbody, tfoot, thead, tr, th, td, pre, code {
margin:0px; padding:0px; border:0 none; outline:0; vertical-align:baseline;}
</style>
<body>
</body>
</html>
然后您可以在客户端页面上放置一个内容控件来覆盖主页面,并在其余页面上省略内容控件(它们将继承默认值)。
我建议使用单独的 CSS 文件而不是直接嵌入它,但您也可以轻松完成。
关于asp.net - MasterPage 和 ContentPage Body Css 问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7502162/
我的 Xamarin 项目中有多个 ContentPage xaml 文件。我想将一个共享的 xaml 嵌入到每个 ContentPage 中。共享的 xaml 部分没有什么特别之处(它不需要做任何特
有没有办法判断当前是否显示了 ContentPage? 我需要在 ContentPage 的事件处理程序中编写代码来检查页面当前是否显示并采取相应行动。 最佳答案 除了GBreen12的回答,你也可以
通常,使用 NavigationStack 弹出当前页面: Navigation.PopAsync( true ); 如何使用Navigation重绘当前页面之前的页面? 背景:当前页面更改了一
我有一些 XAML ContentPages 上面有 ContentView 对象。因此,通常我会根据在 ContentPage 中设置的 this.Width 和 this.Height 值来调整这
我正在使用Xamarin表单来生成由更多ContentPages组成的TabbedPage。这是导致麻烦的代码部分: public void launchMainDesign(object s
我试图通过在 App.xaml 中定义一个设置 BackgroundColor 属性的隐式样式来全局更改我的应用程序中所有 ContentPage 控件的背景。 虽然 Xamarin 中的隐式样式似乎
我试过这个:iPhone MonoTouch - Get Version of Bundle NSBundle.MainBundle.ObjectForInfoDictionary("CFBundle
我正在 ~/View.cshtml 尝试一个非常简单的内容页面,其中包含 @inherits ViewPage @{ Layout = "SimpleLayout";
我有一个 ContentPage 类。 我在类中创建一个任务并具有以下简单的代码: async Task ScoutingTimeThread() { while (true) {
这是我的代码: ..... 有大量的标签,以至于它们从
我有以下内容页面,我想在其中加载 Steema Teechart,但我不能,因为我无法使 MainPage 异步: 我的主页: public class MainPage : ContentPage
Xamarin.Forms VS2013 开发环境 我知道还有其他关于此的主题,但它们没有回答我的问题。 对于 Android,背景图片效果很好。 BackgroundImage = Device.O
我正在尝试将一些自定义内容页面放入选项卡式页面中。遗憾的是,我不确定如何使用 XAML 语法执行此操作。我的虚拟项目如下所示: 第 1 页 第2页完全一样。标签页:
我试图设置 ContentsPage BackgroundImage,但在大屏幕设备上图像一直平铺。 这里有人知道如何阻止图像平铺吗? 已编辑 这是 iPad 上发生的事情的图像。 这是它在手机上的样
如何创建一个基本的 contentpage 类来继承 xamarin 表单? 我关注了这个 forum咨询。 一切都很好,直到我必须解决 Xaml 部分。 using System; using Xa
我有 ContentView在 CarouselPage .我导航到 ConentPage来自 ContentView .更新 ContentPage并返回 ContentView . 现在,在这张纸
我有一个具有以下页面结构的应用程序: MainPage ->SettingsPage ->InputLanguagePage
是否可以从母版页访问位于内容页中的控件(使用内容占位符,更准确地说是多 View 控件)? 情况是,我在母版页中有一个带有按钮的菜单。 现在在我的内容页面中,我有 1 个内容占位符。具有多个 View
最近在 Xamarin 工作,如果我尝试为 ContentPage 设置样式,似乎什么也没有发生 App.xaml 的 ResourceDictionary 中的 Xaml: 我知道正在
我有以下 Contentpage.content,我在其中设置了某些绑定(bind)上下文。 在 Post.xaml.cs (ContentView) 中,我尝试以这种方式获
我是一名优秀的程序员,十分优秀!