TomVision
TomVision
  • 发布:2019-03-18 14:50
  • 更新:2019-03-18 15:16
  • 阅读:1187

plus.nativeObj.view 位置重叠

分类:HTML5+
                                const pages = getCurrentPages();    
                const page = pages[pages.length - 1];  
                const currentWebview = page.$getAppWebview();    

                const icon1 = new plus.nativeObj.Bitmap('icon1');  
                icon1.load('/static/xinxi.png')  
                const icon2 = new plus.nativeObj.Bitmap('icon2');  
                icon2.load('/static/saoma.png')  

                const footer = new plus.nativeObj.View("footer",  
                    {  
                        bottom:'0',  
                        left:'0',   
                        right: '0',   
                        height:'50px',  
                        backgroundColor:'#91b72d'  
                    }  
                );    

                const infoIcon = new plus.nativeObj.View("infoIcon", {left: 'auto', bottom: '0', width: '50px', height:'50px', backgroundColor:'#91b72d'})  
                const cameraIcon = new plus.nativeObj.View("cameraIcon", {right: 'auto', bottom: '0', width: '50px', height:'50px', backgroundColor:'#91b72d'})  

                infoIcon.drawBitmap(icon1, {top:'0',left:'0',width:'100%',height:'100%'}, {top:'10px',left:'10px',width:'30px',height:'30px'});  
                cameraIcon.drawBitmap(icon2, {top:'0',left:'0',width:'100%',height:'100%'}, {top:'10px',left:'10px',width:'30px',height:'30px'});  

                currentWebview.children()[0].append(footer);    
                currentWebview.children()[0].append(infoIcon);    
                currentWebview.children()[0].append(cameraIcon);  

infoIcon与cameraInfo重叠在左下角了,cameraIcon写的是right auto,怎么会在左边

2019-03-18 14:50 负责人:无 分享
已邀请:
TomVision

TomVision (作者)

现在左右的按钮通过获取设备宽度减去按钮宽度 设置left解决 了

该问题目前已经被锁定, 无法添加新回复