使用html2canvas一直报错,有用过的大神指教一下吗

一直报错onrendered option is deprecated, html2canvas returns a Promise with the canvas as the value!如下图
图片说明

0

6个回答

js代码

  $("#btn_upload4").click(function () {
         var  filename = 1+ "_fansImages.pdf";
             // 将 id 为 Modal5 的 div 渲染成 canvas
            html2canvas(document.getElementById("Modal5"), {

                // 渲染完成时调用,获得 canvas
                onrendered: function(canvas) {

                    // 从 canvas 提取图片数据
                    var imgData = canvas.toDataURL('image/jpeg');

                    var canWidth = canvas.width;
                    var canHeight = canvas.height;
                    var arrDPI = js_getDPI();//获取显示器DPI
                    var dpiX = 96;
                    var dpiY = 96;
                    if(arrDPI.length>0){
                        dpiX = arrDPI[0];
                        dpiY = arrDPI[1];
                    }

                    // var doc = new jsPDF("p", "mm", "a4");
                    var doc = new jsPDF('', 'in', [(canWidth+10)/dpiX,(canHeight+10)/dpiY]);//设置PDF宽高为要显示的元素的宽高,将像素转化为英寸  
                    // doc.addImage(imgData, 'JPEG', 0, 0,210,297);
                    doc.addImage(imgData, 'JPEG', 0, 0,0,0);

                    doc.save(filename);
                },
               background : "#f7f7f7"    //设置PDF背景色(默认透明,实际显示为黑色)
            });  
     })

html代码

 <div class="modal fade" id="Modal5" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="z-index: 1050;">
                    <div class="modal-dialog modal-lg" >
                        <div class="modal-content" style="width:1000px;margin-left:-5%" >
                            <div class="modal-header" style="height:60px">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title" id="myModalLabel" style="float:left ;">正太分析图</h4>
                                <button type="button" class="btn btn-default" style="background-color:#337ab7;color:#fff;margin-top:3px;float:right" id="btn_upload4" >打印正太图</button>
                            </div>
                            <!--startprint-->
                            <div class="modal-body">
                                <div class="ibox" >
                                    <div style="width:21%;height:40%; float:left; border:1px solid;margin-top:30px" >
                                        <p style="text-align: center;">Process Data</p></br>
                                            <div class="col-md-6">LSL:</div>
                                            <div class="col-md-6"><span id="lsl"></span></div>
                                            <div class="col-md-6">Target:</div>
                                            <div class="col-md-6"><span id="Target"></span></div>
                                            <div class="col-md-6">USL:</div>
                                            <div class="col-md-6"><span id="USL"></span></div>
                                            <div class="col-md-6">SampleM:</div>
                                            <div class="col-md-6"><span id="SM"></span></div>
                                            <div class="col-md-6">SampleN:</div>
                                            <div class="col-md-6"><span id="SampleN"></span></div>
                                            <div class="col-md-6">Within:</div>
                                            <div class="col-md-6"><span id="Within"></span></div>
                                            <div class="col-md-6">Overall:</div>
                                            <div class="col-md-6"><span id="Overall"></span></div>
                                    </div>
                                    <!-- echart图 -->
                                    <div id="main" style="width: 500px;height:300px;background-color: #ffffff;margin: 0 auto"></div>
                                    <div style="width: 22%;height:20% ; float:right;margin-top:-31%;">
                                        <div style="border:1px solid;width:150px;height:50px">
                                            <p>————With in</p>
                                            <p>—— ——Over all</p>
                                        </div>
                                        <div style="border:1px solid;width:200px;height:150px;margin-top:5px">
                                            <p style="text-align: center;">Potential(Within)Capabilitys</p>
                                            <div class="col-md-6">Cp:</div>
                                            <div class="col-md-6"><span id="Cp"></span></div>
                                            <div class="col-md-6">CPL:</div>
                                            <div class="col-md-6"><span id="CPL"></span></div>
                                            <div class="col-md-6">CPU:</div>
                                            <div class="col-md-6"><span id="CPU"></span></div>
                                            <div class="col-md-6">CPK:</div>
                                            <div class="col-md-6"><span id="CPK"></span></div>
                                            <div class="col-md-6">CCPK:</div>
                                            <div class="col-md-6"><span id="CCPK"></span></div>

                                        </div>
                                        <div style="border:1px solid;width:200px;height:150px;">
                                            <p style="text-align: center;">Overall Capability</p>
                                            <div class="col-md-6">Pp:</div>
                                            <div class="col-md-6"><span id="Pp"></span></div>
                                            <div class="col-md-6">PPL:</div>
                                            <div class="col-md-6"><span id="PPL"></span></div>
                                            <div class="col-md-6">PPU:</div>
                                            <div class="col-md-6"><span id="PPU"></span></div>
                                            <div class="col-md-6">PPK:</div>
                                            <div class="col-md-6"><span id="PPK"></span></div>
                                            <div class="col-md-6">CPM:</div>
                                            <div class="col-md-6"><span id="CPM"></span></div>

                                        </div>
                                    </div>
                                    <div class="content" style="width: 100%;height:20%;margin-top: 8%;">
                                        <div id="right" style="border:1px solid;width:225px;height:130px;margin-top:5px">
                                            <p style="text-align: center;">O bserv ed Performnance</p>
                                            <div class="col-md-6">PPM &lt LSL:</div>
                                            <div class="col-md-6" style="text-align:center"><span id="ppmlsl" ></span></div>
                                            <div class="col-md-6">PPM &gt USL:</div>
                                            <div class="col-md-6" style="text-align:center"><span id="ppmtotal" ></span></div>
                                            <div class="col-md-6">PPM Total:</div>
                                            <div class="col-md-6" style="text-align:center"><span id="ppmusl" ></span></div>
                                        </div>      
                                        <div  id="mid" style="border:1px solid;width:225px;height:130px;margin-top:5px;">
                                            <p style="text-align: center;">Exp.Within Performance</p>
                                            <div class="col-md-6">PPM &lt LSL:</div>
                                            <div class="col-md-6" style="text-align:center"><span id="ppmlsls" ></span></div>
                                            <div class="col-md-6">PPM &gt USL:</div>
                                            <div class="col-md-6" style="text-align:center"><span id="ppmtotals" ></span></div>
                                            <div class="col-md-6">PPM Total:</div>
                                            <div class="col-md-6" style="text-align:center"><span id="ppmusls" ></span></div>
                                        </div>
                                        <div id="left" style="border:1px solid;width:225px;height:130px;margin-top:5px">
                                            <p style="text-align: center;">Exp.Overall Performance</p>
                                            <div class="col-md-6">PPM &lt LSL:</div>
                                            <div class="col-md-6" style="text-align:center"><span id="ppmlsl1" ></span></div>
                                            <div class="col-md-6">PPM &gt USL:</div>
                                            <div class="col-md-6" style="text-align:center"><span id="ppmtotal1" ></span></div>
                                            <div class="col-md-6">PPM Total:</div>
                                            <div class="col-md-6" style="text-align:center"><span id="ppmusl1" ></span></div>
                                        </div>
                                        <div id="passTital" style="border:1px solid;width:165px;height:130px;margin-left:5px;margin-top:5px;float:left">
                                            <p style="text-align: center;">Percent Of Pass</p >
                                            <div class="col-md-6">PASS:</div>
                                            <div class="col-md-6" style="text-align:center"><span id="pass" ></span></div>

                                        </div>          
                                    </div>  
                                    </div>
                                </div>
                            </div>
                            <!--endprint--> 
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal -->
                </div>
0

你把代码贴一下 ,前端和后台的

0
fangBlood
fangBlood 问题无法编辑了,答案贴在下面了 你看一下
11 个月之前 回复

你是要把DIV保存为图片对吗?

0

重新下一份源码,估计是源码有问题

0

好像如果ie的话jspdf会抛错的

0

最新的html2canvas已经弃用了onrendered,改成以下代码:

html2canvas(document.body,{ width:200,height:100 }).then(function(canvas){
        var imgUri = canvas.toDataURL();
        $("body").append('<a href="'+imgUri+'" download="下载的图片">保存图片</a>');
    });
0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
有大神用过steeltoe的吗?
主要是为了兼容4.5以下的API项目把服务注册到springcloud服务中心,现在用官方示例跑起来都不注册不进去,但是自己用core写的示例就没问题,请问有大神知道什么原因吗?或者有更多示例可以给出参考的?
有大神用过gmap.net吗?
为什么我加的图层上的标签开始时,集中在一点而不是它们设置的位置。然后动一下地图(放大,缩小等)标签就正常了,就分布在原来所设的位置。
各位大神指教一下
[size=18px][b]我朋友也想学习开发,但是不知道做Java好还是安卓好还是php或C好。各位大神述说一下,像说哪个说的好都很牛的这种话就不用说了。 我想知道相对而言好些[/b][/size][/size]
有大神用过旗正的规则引擎吗?
部署在liunx上,头几次调用往往失败,成功后就好了
FnordMetric chartsql插件有大神用过吗?
能在Windows系统系统上运行吗?求Windows系统安装运行详细教程?
登录页面一直报错,求指教。
using System;rnusing System.Data;rnusing System.Data.SqlClient;rnusing System.Configuration;rnusing System.Collections;rnusing System.Web;rnusing System.Web.Security;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.WebControls.WebParts;rnusing System.Web.UI.HtmlControls;rnrnpublic partial class Login : System.Web.UI.Pagernrn protected void Page_Load(object sender, EventArgs e)rn rnrn rn protected void btnLogin_Click(object sender, EventArgs e)rn rn SqlConnection cn = Com.GetConnection();rn SqlCommand cmd = new SqlCommand("select password,salt,role from Login where loginID=@loginID", cn);rn SqlParameter id = new SqlParameter("@loginID",SqlDbType.VarChar);rn id.Value= tbUserID.Text;rn cmd.Parameters.Add(id);rn SqlDataReader dr = null;rnrn tryrn rn cn.Open();rn dr = cmd.ExecuteReader();rn if (dr.Read()) // 返回有记录,即存在该用户IDrn rn string pwd = tbPassword.Text + dr["salt"].ToString();rn pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(pwd, "SHA1");rn if (pwd == dr["password"].ToString()) // 认证成功rn rn Session["LoginID"] = tbUserID.Text;rn string role = dr["role"].ToString();rn Session["LoginRole"] = role;rn Response.Redirect("Default.aspx");rn return;rn rn else // 密码不正确rn rn Com.MessageBox("密码不正确,请回到登录界面重新登录!", "登录验证", "../Login.aspx");rn return;rn rn rn else // 不存在该用户ID的记录rn rn Com.MessageBox("不存在该用户,请回到登录界面重新登录!", "登录验证", "../Login.aspx");rn return;rn rn rn catch (SqlException ex)rn rn Com.MessageBox("数据库操作出错!出错信息为:\n" + ex.Message + "请回到登录界面重新登录!", "登录验证", "../Login.aspx");rn rn finallyrn rn dr.Close();rn cn.Close();rn rn rnrn
请大神指教一下,这两个有什么区别?
我是一名学生,因为刚接触JAVA没多久,所以对JAVA的理解也不是太到位,请大家不要吐糟我。rn 下面是两种交换值得JAVA程序,一个输出是System.out.println("显示a:"+a);跟system.out.println("显示b:"+b);一个是输出rnsystem.out.printf("显示a"+a.tostring());跟System.out,println("显示b"+b.tostring());两个输出的结果都是相同的,我想知道加了.tostring()有什么用,请大神指教一下。rnpackage swap;rnrnpublic class swap rnpublic void swap(String a,String b)rnrnString temp;rnSystem.out.println("a显示:"+a);rnSystem.out.println("b显示:"+b);rntemp=a;a=b;b=temp;rnSystem.out.println();rnSystem.out.println("调用方法以后");rnSystem.out.println("a显示:"+a);rnSystem.out.println("b显示:"+b);rnrnpublic static void main(String[] args)rnrnString foo=new String("Mar1 2005 2:5:3");rnString bar=new String("Jan 2004 12:2:2");rnswap swapTime=new swap();rnSystem.out.println("调用方法以前");rnSystem.out.println("foo显示:"+foo);rnSystem.out.println("bar显示:"+bar);rnswapTime.swap(foo,bar);rnSystem.out.println("foo显示:"+foo);rnSystem.out.println("bar显示:"+bar);rnrnrn这是加上.tostring()后的 :rnpackage swap;rnrnpublic class swap rnpublic void swap(String a,String b)rnrnString temp;rnSystem.out.println("a显示:"+a.toString ());rnSystem.out.println("b显示:"+b.toString ());rntemp=a;a=b;b=temp;rnSystem.out.println();rnSystem.out.println("调用方法以后");rnSystem.out.println("a显示:"+a.toString ());rnSystem.out.println("b显示:"+b.toString ());rnrnpublic static void main(String[] args)rnrnString foo=new String("Mar1 2005 2:5:3");rnString bar=new String("Jan 2004 12:2:2");rnswap swapTime=new swap();rnSystem.out.println("调用方法以前");rnSystem.out.println("foo显示:"+foo.toString ());rnSystem.out.println("bar显示:"+bar.toString ());rnswapTime.swap(foo,bar);rnSystem.out.println("foo显示:"+foo.toString ());rnSystem.out.println("bar显示:"+bar.toString ());rnrn
struct inode 有用过的吗?请指教!
我想在内核层得到文件最后修改时间和大小,在网上查到要用到inode结构体,但不知道怎么用呀?还请指教!rn刚接触linux,就得搞内核开发~ .~rnrneg:rnstruct inodernrnloff_t i_size;rnrnstruct timespec i_mtime;rnrnrn
有用过crystall reports 的吗?请指教?
在报表中如何使定义的LABEL值等于窗体中的label值。
有用过IntnetDB的吗?请指教!
俺想添加一个记录,auto increment类型的如何添加。rnrn
html2canvas的使用
RT [img=https://img-bbs.csdn.net/upload/201410/10/1412924003_916788.png][/img]rnrnrn我想将VLC这一块地方截图并保存 经查询好像这个JS类库能够实现我的要求 但是我对这一块不熟悉 希望知道的可以帮我下 谢谢~~~~~~
有用过ZIPC的吗?进来交流一下!
大家交流一下对ZIPC的感受!rn什么都可以!rn
有用过GetAdaptersInfo的吗?给介绍一下!
-
有用过dreamweaverMX2004的吗,小问题请教一下!
rnrn rn rn rnrn rnrnrnrn为什么在mx2004的设计区里面显示不出 里面的内容-----一个表格,rn而在mx下是能显示出来的,可能有哪里设置一下,可是几乎所有地方都查找了,都没解决,rn请知道的大哥指教一下!rn
有用过AddFlow控件的吗?交流一下~
请问成功加载了AddFlow.ocx控件后,画出的流程图想转化为XML格式的代码,如何使用XMLFlow.ocx中的成员函数SaveFlowToXML?
程序报错,求大神指教
adodataset1.Fiter:='Number'+''''+edit1.Text+'''';n为什么报错说nunable to invoke code completion due to errors in source coden求大神解析一下为什么T_T
有用过JB6的吗,指点一下好吗?
我用JB6编写了一个小程序,比如说是打印"hello,world",rn但是我一运行的时候,系统提示说找不到main class,怎么办?rn希望各位大侠指点一下详细一点谢谢。
MedXpress 控件,有用过的吗?交流一下!
MedXpress 控件,有用过的吗?交流一下!
有用过lucene的吗??请问一下
import java.io.FileInputStream;rnimport java.io.InputStream;rnimport java.io.InputStreamReader;rnimport java.io.Reader;rnrnrnimport org.apache.lucene.analysis.SimpleAnalyzer;rnimport org.apache.lucene.document.Document;rnimport org.apache.lucene.document.Field;rnimport org.apache.lucene.index.IndexWriter;rnrn/*rn * Created on 2003-12-3rn *rn * To change the template for this generated file go torn * Window>Preferences>Java>Code Generation>Code and Commentsrn */rnrn/**rn * @author Administratorrn *rn * To change the template for this generated type comment go torn * Window>Preferences>Java>Code Generation>Code and Commentsrn */rnpublic class IndexFiles rn //使用方法:: IndexFiles [索引输出目录] [索引的文件列表] ... rn public static void main(String[] args) throws Exception rn String indexPath = args[0]; //索引输出目录 indexpath rn IndexWriter writer; rn //用指定的语言分析器构造一个新的写索引器(第3个参数表示是否为追加索引) rn writer = new IndexWriter(indexPath, new SimpleAnalyzer(), false); rn for (int i=1; i(Unknown Source)rn at org.apache.lucene.index.IndexWriter.(Unknown Source)rn at IndexFiles.main(IndexFiles.java:31)rnException in thread "main" rn应该怎么改??
有用过ADO的吗?交流一下
我的主程序用ADOQuery访问数据库,同时线程中也动态使用ADOQuery访问同一数据库.rn我发现:rn主程序用ADOQuery访问数据库后,线程就会处于锁状态,rn而如果主程序不访问数据库,线程中运行正常.rnrnrn能指出原因和解决办法吗?谢谢
MedXpress控件,有用过的吗?交流一下!
MedXpress 控件,有用过的吗?交流一下!
有用过spring.net的吗?进来指点一下?
xml配置里面rnrn里面的接口与实现类必须在一个assembly下的吗?
请教一下,有用过Active Sync的吗?
怎样做才能在设备与PC同步时,在PC上自动运行一个指定的程序?
有没有用过simpletest的大神吗
如题。够了十个字了没有
有大神可以帮忙解决一下吗
Android使用CLE,初始化rn[img=https://img-bbs.csdn.net/upload/201906/23/1561257366_29432.jpg][/img]rn直接闪退不报错rn设了断点发现到这程序就中止了rnstarcore= StarCoreFactory.GetFactory()
求大神指教一下问题所在
这是我项目里查询数据库方法里其中之一,之前用Oracle数据库时没有异常,rn[code=java]public DocumentImpl selectRecordById(DocumentImpl doc)rn String name=null;rn String val=null;rn NodeList children = doc.getDocumentElement().getChildNodes();rn name=children.item(0).getNodeName();rn val=children.item(0).getTextContent();rn //查询rn Connection con=null; rn DocumentImpl result=new DocumentImpl();rn Element root = result.createElement("root");rn result.appendChild(root);rn tryrn con=JdbcUtil.getConnection();rn con.setAutoCommit(false);rn String sql="select * from clerk_ledger_xjy where "+name+" = ?";rn //System.out.println(sql);rn PreparedStatement ps = con.prepareStatement(sql);rn ps.setString(1, val);rn con.commit();rn ResultSet rs = ps.executeQuery();rn ResultSetMetaData rsmd = rs.getMetaData();rn int count = rsmd.getColumnCount();rn int row=1;rn while(rs.next())rn Element rows = result.createElement("row"+row);rn root.appendChild(rows);rn for (int i = 1;i <= count;i++)rn String key = rsmd.getColumnLabel(i).toLowerCase();rn String value = (rs.getString(key)==null?"":rs.getString(key));rn WSDomUtil.appendChildNode(result , rows, key, value);rn //System.out.println(key+":"+value); rn rn row++;rn rn rn catch (Exception e) rn e.printStackTrace();rn try rn con.rollback();rn catch (SQLException e1) rn e1.printStackTrace();rn rn throw new RuntimeException(rn "查询失败", e);rn finally rn JdbcUtil.close(con);rn rn rn// try rn// System.out.println(WSDomUtil.convertXMLDOMToString(result));rn// catch (Exception e) rn// e.printStackTrace();rn// rn return result;rn [/code]rn现在换成数据库db2,方法调用的时候老是报错:rn[code=text]com.ibm.db2.jcc.am.SqlException: [jcc][t4][10251][10308][3.57.82] 正在连接上执行事务时,请求了 java.sql.Connection.close()。rn事务仍然保持活动状态,不能关闭连接。 ERRORCODE=-4471, SQLSTATE=nullrn com.ibm.db2.jcc.am.bd.a(bd.java:660)rn com.ibm.db2.jcc.am.bd.a(bd.java:60)rn com.ibm.db2.jcc.am.bd.a(bd.java:120)rn com.ibm.db2.jcc.am.jb.u(jb.java:1167)rn com.ibm.db2.jcc.am.jb.x(jb.java:1190)rn com.ibm.db2.jcc.am.jb.v(jb.java:1176)rn com.ibm.db2.jcc.am.jb.close(jb.java:1160)rn util.JdbcUtil.close(JdbcUtil.java:41)rn dao.SelectDao.selectById(SelectDao.java:63)rn service.QueryServiceImpl.finduser(QueryServiceImpl.java:18)rn web.QueryController.query(QueryController.java:55)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn java.lang.reflect.Method.invoke(Unknown Source)rn org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)rn org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)rn org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)rn org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)rn org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)rn org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)rn org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)rn org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)rn org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)rn org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:624)rn org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:731)rn org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)[/code]rn上面已经commit过,事务已经提交 ,下面关闭连接怎么还会出问题 ,求大神指教[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/20.gif][/img]
有高手给我指教一下吗?
请问msyql里面的插入有没有同步插入和异步插入的说法:rnrn同步:执行一条插入语句,就把数据写进硬盘。rn异步:要在内存中存储一定数量的语句后,再一次性写进硬盘里面rnrn我好像听过这种说法,请问大家有没有这种说法。如果有,是不是有什么参数可以设置呢?
android报错,大神来看一下
n求大神给我看一下n```n java.lang.RuntimeException: Unable to start activity ComponentInfocom.anew/com.anew.MainActivity: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.n at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2688)n at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2749)n at android.app.ActivityThread.-wrap12(ActivityThread.java)n at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1498)n at android.os.Handler.dispatchMessage(Handler.java:102)n at android.os.Looper.loop(Looper.java:160)n at android.app.ActivityThread.main(ActivityThread.java:6197)n at java.lang.reflect.Method.invoke(Native Method)n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:874)n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:764)nCaused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.n at android.support.v7.app.AppCompatDelegateImplV9.setSupportActionBar(AppCompatDelegateImplV9.java:207)n at android.support.v7.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:130)n at com.anew.MainActivity.onCreate(MainActivity.java:19)n at android.app.Activity.performCreate(Activity.java:6736)n at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)n at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2641)n ... 9 morenn```nn
运行后一直报错,求大神指点
[img=https://img-bbs.csdn.net/upload/201605/10/1462859149_351537.png][/img][img=https://img-bbs.csdn.net/upload/201605/10/1462858802_133884.png][/img]rnrnrn2016-5-10 13:52:28 org.apache.catalina.core.AprLifecycleListener initrn信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\MyEclipse 6.5\bin;D:\MyEclipse 6.5\myeclipse\eclipse\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_6.5.0.zmyeclipse650200806\tomcat\binrn2016-5-10 13:52:28 org.apache.coyote.http11.Http11Protocol initrn信息: Initializing Coyote HTTP/1.1 on http-8080rn2016-5-10 13:52:28 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 456 msrn2016-5-10 13:52:28 org.apache.catalina.core.StandardService startrn信息: Starting service Catalinarn2016-5-10 13:52:28 org.apache.catalina.core.StandardEngine startrn信息: Starting Servlet Engine: Apache Tomcat/6.0.13rn2016-5-10 13:52:28 org.apache.tomcat.util.modeler.Registry registerComponentrn严重: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/gdglsys,J2EEApplication=none,J2EEServer=nonern2016-5-10 13:52:28 org.apache.catalina.startup.HostConfig deployDirectoryrn严重: Error deploying web application directory gdglsysrnjava.lang.UnsupportedClassVersionError: Bad version number in .class filern at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(Unknown Source)rn at java.security.SecureClassLoader.defineClass(Unknown Source)rn at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)rn at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)rn at org.apache.catalina.startup.WebAnnotationSet.loadClassAnnotation(WebAnnotationSet.java:145)rn at org.apache.catalina.startup.WebAnnotationSet.loadApplicationFilterAnnotations(WebAnnotationSet.java:84)rn at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:57)rn at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:297)rn at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1064)rn at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4236)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:566)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rn2016-5-10 13:52:28 org.apache.coyote.http11.Http11Protocol startrn信息: Starting Coyote HTTP/1.1 on http-8080rn2016-5-10 13:52:28 org.apache.jk.common.ChannelSocket initrn信息: JK: ajp13 listening on /0.0.0.0:8009rn2016-5-10 13:52:28 org.apache.jk.server.JkMain startrn信息: Jk running ID=0 time=0/27 config=nullrn2016-5-10 13:52:28 org.apache.catalina.startup.Catalina startrn信息: Server startup in 817 msrn求大神帮帮忙!!!
一直报错 求大神告知原因
这是一个关系合成的代码rn[code=python]a=list(input('Relation R:'))rnb=list(input('Relation R:'))rnc=[]rnk=0rnfor i in range (len(a)):rn for j in range (len(b)):rn if int(a[i][1])==int(b[j][1]):rn c.append([])rn c[k].append(a[i][0])rn c[k].append(b[j][1])rn k+=1rnprint 'a。b='+c[/code]rnRelation R:(1,2)rnRelation R:(2,3)rnTraceback (most recent call last):rn rn if int(a[i][1])==int(b[j][1]):rnTypeError: 'int' object has no attribute '__getitem__'
这个报错一直解决不了,求大神解决!!!!!
可能存在类似的问题:n![图片说明](https://img-ask.csdn.net/upload/201707/20/1500542651_757372.png)
php编译一直报错,大神们速来
CentOS release 6.4 (Final)rn编译php-5.5.38rngcc-c++-4.4.7-17.el6.x86_64rngcc-4.4.7-17.el6.x86_64drn编译参数--prefix=/usr/local/php --with-config-file-path=/usr/local/php --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --enable-opcache --enable-sockets --enable-soap --enable-mysqlnd --with-mysql-sock -with-mysql --with-mysqli --with-pdo-mysql --without-pearrnmake 1>/dev/nullrn/root/php-5.5.38/ext/session/session.c: 在函数‘ps_srlzr_decode_php_serialize’中:rn/root/php-5.5.38/ext/session/session.c:866: 警告:传递‘php_var_unserialize’的第 2 个参数时在不兼容的指针类型间转换rn/root/php-5.5.38/ext/standard/php_var.h:53: 附注:需要类型‘const unsigned char **’,但实参的类型为‘const char **’rn/root/php-5.5.38/Zend/zend_compile.c: 在函数‘zend_traits_copy_functions’中:rn/root/php-5.5.38/Zend/zend_compile.c:4021: 警告:赋值丢弃了指针目标类型的限定rnrn编译一直出错,换成CentOS7也一样出错,真搞不懂了,google一直解决不了,源码肯定没问题,大概都是依赖库版本问题?但是不知道是哪个rn
jmail 报错!!高手指教一下!
分析器错误信息: 找到的名为“jmail”的程序集清单定义与程序集引用不匹配。 rn
有用过vs2012的吗?
vs2012增加了c++的智能感知功能,就是那个自动提示的功能。rn但是有一个细节,不知道有没有解决方法?rnrn就是智能提示出来后,有一个方框把某一行框住了,但是我按回车后,vs并没有把方框选中的项输进去,而是直接换行了,郁闷~~ rnrn有哪位知道如何解决吗?
有用过PetePoco的吗?
在用PetePoco的时候,遇到多条件查询,此时Sql语句根据不同情况是不一样的,平常PetePoco是通过rn[code=csharp]rn PetePocoInstance.Fetch("where WareHouseId=@0",2) //@0来标记的rn[/code]rn此时如果条件参数过多且动态的话,没法把相应的参数对应到具体的@0,@1,@2......等。想通过命名参数来实现,如:rnrn[code=csharp]rn PetePocoInstance.Fetch("where WareHouseId=@WareHouseId",2) rn[/code]rnrn但是经过研究发现,PetePoco貌似不支持此种写法,有知道解决方案的吗?没的话只好改写它的底层了!
按键精灵有用过的吗
它是用rnSetWindowsHookEx(WH_JOURNALRECORD。。。rn以及rnSetWindowsHookEx(WH_JOURNALPLAYBACK这两种hook实现的么?rnrn我用这两种hook做了试例,但在回放的过程中,就不能控制鼠标了,但按键精灵中回放时,还是可以控制鼠标。rn这是怎么回事?是我的代码有问题,还是他们根本不是用这种hook实现的?
有用过G729a的吗?
G729a.lib就导出四个函数:rnextern "C" void va_g729a_init_encoder();rnextern "C" void va_g729a_encoder(short *speech, unsigned char *bitstream);rnextern "C" void va_g729a_init_decoder();rnextern "C" void va_g729a_decoder(unsigned char *bitstream, short *synth_short, int bfi);rnrn我测试了,声音不对呀,谁测试过了的,能不能介绍一下呀,谢谢!
有用过ePass1000ND的吗?
官网上下载了一个c#的例子,但是在本机运行报com组件的错误 有知道怎么用的人吗? 能指点下rnrn
EditPlus有用过的吗?
他的编辑区上面的标尺和左边的行号是怎么做的,并且光标所在的行在标尺和行号中能够对应的反映出来,有了解的吗?
有用过omniORB的吗
正在做omniORB通讯的东西,刚刚接触,晕啊,谁能给些帮助啊,尤其是安装配置方面,晕死了,谢谢了!
相关热词 c# 线程顺序 c#昨天当前时间 c# 多进程 锁 c#mysql图片存取 c# ocx 委托事件 c# 读取类的属性和值 c# out 使用限制 c#获取url的id c#怎么进行分页查询 c# update 集合