当前位置:K88软件开发文章中心编程语言APP编程CrossApp → 文章内容

CAWebView(Web视图控件)

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-23 13:52:20

由 ?﹏???ζ???﹏﹏? 创建, 最后一次修改 2016-09-08 类说明Web视图控件CAWebView 属性(点击查看方法介绍)属性说明WebViewDelegateWebView代理类CAWebView 方法(点击查看方法介绍)方法说明init初始化createWithFrame创建,并指定其FramecreateWithCenter创建,并设置其CentersetJavascriptInterfaceSchemeJavaScript接口方法loadHTMLString加载HTML字符串loadURL加载URLloadFile加载FilestopLoading停止加载reload重载canGoBack可以后退canGoForward可以前进goBack返回goForward前进evaluateJSevaluateJSgetHTMLSource获取HTMLSourcesetScalesPageToFit设置页面适度大小hideNativeWebAndShowImage隐藏本地网络和显示图像showNativeWeb显示本地网络update更新draw显示setVisible设置可见setActivityView设置活动视图showLoadingActivity显示加载活动CAWebView 属性说明WebViewDelegate类型:CAWebViewDelegate*解释:WebView代理类,set/get{}。CAWebView 方法说明virtual bool init();返回值:bool参数:解释:初始化    static CAWebView* createWithFrame(const DRect& rect);返回值:CAWebView*参数:类型参数名说明const DRect&rect区域大小解释:创建,并指定其Framestatic CAWebView* createWithCenter(const DRect& rect);返回值:CAWebView*参数:类型参数名说明const DRect& rect中心点的位置及大小解释:创建,并设置其Centervoid setJavascriptInterfaceScheme(const std::string &scheme);返回值:void参数:类型参数名说明const std::string schemescheme解释:JavaScript接口方法void loadHTMLString(const std::string &string, const std::string &baseURL);返回值:void参数:类型参数名说明const std::string&stringstringconst std::string&baseURLURL地址解释:加载HTML字符串void loadURL(const std::string &url);返回值:void参数:类型参数名说明const std::string&urlURL地址解释:加载URLvoid loadFile(const std::string &fileName);返回值:void参数:类型参数名说明const std::string&fileNameFile解释:加载Filevoid stopLoading();返回值:void参数:解释:停止加载void reload();返回值:void参数:解释:重载bool canGoBack();返回值:bool参数:解释:可以后退bool canGoForward();返回值:bool参数:解释:可以前进void goBack();返回值:void参数:解释:返回void goForward();返回值:void参数:解释:前进std::string evaluateJS(const std::string &js);返回值:std::string 参数:类型参数名说明const std::string&jsJS解释:evaluateJSstd::string getHTMLSource();返回值:std::string 参数:解释:获取HTMLSourcevoid setScalesPageToFit(const bool scalesPageToFit);返回值:void参数:类型参数名说明boolscalesPageToFitscalesPageToFit解释:设置页面适度大小void hideNativeWebAndShowImage();返回值:void参数:解释:隐藏本地网络和显示图像void showNativeWeb();返回值:void参数:解释:显示本地网络virtual void update(float dt);返回值:void参数:类型参数名说明floatdtdt解释:更新virtual void draw();返回值:void参数:解释:显示virtual void setVisible(bool visible);返回值:void参数:类型参数名说明boolvisiblevisible解释:设置可见void setActivityView(CAActivityIndicatorView* loadingView);返回值:void参数:类型参数名说明CAActivityIndicatorView*loadingView加载视图解释:设置活动视图void showLoadingActivity(bool show);返回值:void参数:类型参数名说明boolshow显示解释:显示加载活动

CAWebView(Web视图控件)