我在react native中有2个屏幕,我想使标签导航器透明,它可以工作,但是添加import { Component_to_insert } from 'path';
import { Component, ViewChild, ViewContainerRef, ComponentFactoryResolver, AfterViewInit } from '@angular/core';
@Component({
selector: 'component-name',
templateUrl: 'component.html',
styleUrls: ['component.scss'],
entryComponents: [Component_to_insert]
})
export class ManagetemplatesPanelComponent implements AfterViewInit {
@ViewChild('target', { read: ViewContainerRef }) entry: ViewContainerRef;
constructor(private resolver: ComponentFactoryResolver) { }
ngAfterViewInit() {
this.createComponent();
}
createComponent() {
this.entry.clear();
const factory = this.resolver.resolveComponentFactory(Component_to_insert);
const componentRef = this.entry.createComponent(factory);
}
}
后导航器不可单击,如果我使用的不是绝对的,背景会变成白色(不能透明的)
这是我的tabBarOptions
position: absolute
当我单击tabBarOptions: {
showIcon: true,
showLabel: true,
activeTintColor: 'orange',
inactiveTintColor: '#fff',
style: {
width: '100%',
height: 60,
backgroundColor: 'transparent',
borderTopWidth: 0,
position: 'absolute',
left: 0,
right: 0,
bottom: 10,
},
tabStyle: {
paddingTop: 20,
},
},
选项卡时,什么都没有发生,但是如果我评论Create Order
,那是完美的工作。
答案 0 :(得分:0)
在标签栏样式中添加“ zIndex = 1”
style: {
width: '100%',
height: 60,
backgroundColor: 'transparent',
borderTopWidth: 0,
position: 'absolute',
zIndex: 1,
left: 0,
right: 0,
bottom: 10,
},