{"id":5490,"date":"2021-11-05T16:54:18","date_gmt":"2021-11-05T08:54:18","guid":{"rendered":"http:\/\/xinyiworld.top\/wordpress\/?p=5490"},"modified":"2021-11-05T17:12:50","modified_gmt":"2021-11-05T09:12:50","slug":"view%e7%9a%84%e5%b8%b8%e7%94%a8%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/xinyiworld.top\/wordpress_it\/?p=5490","title":{"rendered":"View\u5e38\u7528\u6765\u590d\u5199\u7684\u65b9\u6cd5"},"content":{"rendered":"<h4>onFinishInflate<\/h4>\n<pre><code class=\"language-java line-numbers\"> \/**\n     * Finalize inflating a view from XML.  This is called as the last phase\n     * of inflation, after all child views have been added.\n     *\n     * &lt;p&gt;Even if the subclass overrides onFinishInflate, they should always be\n     * sure to call the super method, so that we get called.\n     *\/\n    @CallSuper\n    protected void onFinishInflate() {\n    }\n<\/code><\/pre>\n<p>\u901a\u5e38\u81ea\u5b9a\u4e49ViewGroup\u65f6\uff0c\u5728\u6b64\u65b9\u6cd5\u91cc\u83b7\u53d6\u5b50\u63a7\u4ef6\u3002<\/p>\n<h4>onSizeChanged<\/h4>\n<pre><code class=\"language-java line-numbers\"> \/**\n     * This is called during layout when the size of this view has changed. If\n     * you were just added to the view hierarchy, you're called with the old\n     * values of 0.\n     *\n     * @param w Current width of this view.\n     * @param h Current height of this view.\n     * @param oldw Old width of this view.\n     * @param oldh Old height of this view.\n     *\/\n    protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n    }\n<\/code><\/pre>\n<p>\u901a\u5e38\u81ea\u5b9a\u4e49ViewGroup\u65f6\uff0c\u5728\u6b64\u65b9\u6cd5\u91cc\u83b7\u53d6parent\u53cachild\u7684\u6d4b\u91cf\u5bbd\u9ad8\u3002<\/p>\n<h4>onLayout<\/h4>\n<pre><code class=\"language-java line-numbers\">  \/**\n     * Called from layout when this view should\n     * assign a size and position to each of its children.\n     *\n     * Derived classes with children should override\n     * this method and call layout on each of\n     * their children.\n     * @param changed This is a new size or position for this view\n     * @param left Left position, relative to parent\n     * @param top Top position, relative to parent\n     * @param right Right position, relative to parent\n     * @param bottom Bottom position, relative to parent\n     *\/\n    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n    }\n<\/code><\/pre>\n<p>\u901a\u5e38\u7528\u4e8eViewGroup\u590d\u5199\uff0c\u6765\u521d\u59cb\u5316\u5b50\u63a7\u4ef6\u7684\u4f4d\u7f6e\u3002<\/p>\n<button class=\"simplefavorite-button\" data-postid=\"5490\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>onFinishInflate \/** * Finalize inflating a view fr [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[348],"tags":[],"_links":{"self":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/5490"}],"collection":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5490"}],"version-history":[{"count":5,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/5490\/revisions"}],"predecessor-version":[{"id":5495,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/5490\/revisions\/5495"}],"wp:attachment":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5490"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}