我正在使用Xamarin.Forms并尝试更改iOS上导航栏的背景颜色.
我有一个继承自NavigationPage的自定义导航栏类,带有可绑定属性和构造函数,用于设置导航栏的颜色.根据我的理解,导航栏上面有一个默认的背景(黑色)Xamarin.Forms导航背景.我可以使用SetColor()方法设置背景颜色(见下文).然而,它留下了一条黑线,这是导航栏(iOS)的背景,如图所示.图片链接
现在,我正在尝试将iOS导航栏背景颜色设置为白色或透明.我花了很多时间但没有任何效果.有人可以协助如何将背景设置为白色.
//PCL class
public class CustomNavigationalPage : NavigationPage
{
public static readonly BindableProperty BarBgColorProperty =
BindableProperty.
Create<CustomNavigationalPage, UIColor>
(p => p.BarBackgroundColorR, null);
public UIColor BarBackgroundColorR
{
get { return (UIColor)base.GetValue (BarBgColorProperty); }
set { base.SetValue (BarBgColorProperty, value); }
}
public NavigationalPageCustomized() : base()
{
SetColor();
}
void SetColor()
{
BarBackgroundColor = Color.Transparent;
BarTextColor = Color.Blue;
}
}
Run Code Online (Sandbox Code Playgroud)
导航栏渲染器类:
[assembly: ExportRenderer (typeof (CustomNavigationalPage), typeof (CustomNavigationPageRenderer))]
namespace project.iOS
{
public class CustomNavigationPageRenderer : NavigationRenderer
{
public CustomNavigationPageRenderer()
{
// …Run Code Online (Sandbox Code Playgroud) 我将我的项目设置为Empty Template,并将Spring boot项目添加为一个模块,并添加了另一个模块ecomm-models(其中仅包含Java类)。
我无法在Spring Boot项目中访问ecomm模型中的类,即使我将其添加为Spring Boot项目中的依赖项也是如此。
如图所示,这两个项目都在父模块下。
任何建议,那就太好了!
在Spring Boot中添加模型依赖性之后。Spring-boot pom.xml在图片中看起来像这样。
String original = "This is my string val\xc3\xbae";\nRun Code Online (Sandbox Code Playgroud)\n\n我正在尝试将上述字符串编码为 UTF-8 等效项,但仅将特殊字符 (\xc3\xba) 替换为 -- "ú ;" 在这种情况下。
\n\n我已尝试使用以下命令,但出现错误:
\n\n\n\n\n输入不是正确的UTF-8,指示编码!字节:0xFA 0x20 0x63 0x61
\n
代码:
\n\n String original = new String("This is my string val\xc3\xbae");\n\n byte ptext[] = original.getBytes("UTF-8");\n String value = new String(ptext, "UTF-8"); \n\n System.out.println("Output : " + value);\n\n This is my string val\xc3\xbae\nRun Code Online (Sandbox Code Playgroud)\n 我有两个文档,一个是树结构,另一个是第一个doc.我试图通过fk和pk加入这两个doc.我无法得到实际结果,它显示所有空值.
第一份文件
{
"name": "one",
"root": {
"level1" : {
"level2" : {
"level3" : {
"itemone": "Randomkey1",
"itemtwo": "Randomkey2
}
}
}
},
"type": "firstdoc"
}
Run Code Online (Sandbox Code Playgroud)
第二个文件
{
"name" : "two",
"mapBy" : "Randomkey1",
"type" : "senconddoc
}
Run Code Online (Sandbox Code Playgroud)
我写了一个map函数,它列出了给定1级或2级或3级的所有键.现在我想要使用密钥加入第一个doc和第二个doc.我尝试了两种方式(第一种:我得到所有(Root,Randomkey),(docName,Randomkey1)但它没有做任何连接.我正在寻找像(Root,docName)这样的结果
有人可以协助解决这个问题
地图
function(doc) {
if (doc.type === 'firstdoc' || doc.type === 'seconddoc' ) {
var rootObj = doc.Root;
for (var level1 in rootObj) {
var level2Obj = doc.Root[level1];
for (var level2 in level2Obj) {
var keys = new Array();
var …Run Code Online (Sandbox Code Playgroud) 我是Java Spring IoC的新手,这是我的问题
我有一个FactoryConfig类,包含所有bean和注释@Configuration和@ComponentScan,如下所示.
import org.springframwork.*
@Configuration
@ComponentScan(basePackages="package.name")
public class FactoryConfig {
public FactoryConfig() {
}
@Bean
public Test test(){
return new Test();
}
//And few more @Bean's
}
Run Code Online (Sandbox Code Playgroud)
我的Test类有一个简单的Print方法
public class Test {
public void Print() {
System.out.println("Hello Test");
}
}
Run Code Online (Sandbox Code Playgroud)
现在,在我的Main Class中,我创建了一个FactoryConfig的ApplicationContentext.(我希望我的所有@Beans都在Factory配置中初始化.但是,当我使用@Autowired访问Test类时,它返回null
我的主要课程
public class Main {
@Autowired
protected static Test _autoTest;
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
ApplicationContext context =
new AnnotationConfigApplicationContext(FactoryConfig.class);
FactoryConfig config = context.getBean(FactoryConfig.class);
config.test().Print();
// _autoTest.Print(); <--- …Run Code Online (Sandbox Code Playgroud)