什么是android.widget.FrameLayout [英] What is android.widget.FrameLayout

查看:1296
本文介绍了什么是android.widget.FrameLayout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的应用程序,XML布局:

I have a simple App, Layout XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    <WebView
        android:id="@+id/webview"
        android:layout_width="200dp"
        android:layout_height="200dp" />
</RelativeLayout>

当我用下面的code:

When I use following code:

WebView webview = (WebView)findViewById(R.id.webview);
webview.getRootView().findViewById(android.R.id.content);

webview.getRootView()findViewById(android.R.id.content)。 返回android.widget.FrameLayout 何为呢?我从来没有在我app.Is通过Android的默认提供的定义的FrameLayout?

webview.getRootView().findViewById(android.R.id.content); return android.widget.FrameLayout.What is it? I never define FrameLayout in my app.Is that provided by Android by default?

推荐答案

我认为这个问题(尽管关闭)回答它。

I think this question (although closed) answers it.

<一个href=\"http://stackoverflow.com/questions/10668330/difference-between-findviewbyidr-id-content-and-getrootview\">Difference findViewById(R.id.content)和getRootView()

退房层次浏览器工具。如果调试布局非常有帮助的。它会告诉你在你的所有活动的意见,整个树。在几乎每一个活动的根是一个的FrameLayout我相信。

Check out the Hierarchy Viewer tool. If it very helpful for debugging your layouts. It will show you the entire tree of all the views in your Activity. At the root of almost every Activity is a FrameLayout I believe.

这篇关于什么是android.widget.FrameLayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆