Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

"确定View大小(onSizeChanged)" 这一节存在误导

Open
#111 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, java

Research direction

Search the documentation for the section titled "确定View大小(onSizeChanged)" and compare its wording with the linked official onSizeChanged documentation. Clarify that onSizeChanged observes size changes while onMeasure determines the measured size, then verify the revised explanation in context.

Written by the indexing model from the issue text.

Description

onSizeChanged只是在大小被改变时调用,不是用来确定大小的,确定大小就是在onMeasure里面完成的。onMeasure是测量视图的大小的,这个没错,但是它测量大小也就是在确定它的大小,重写时就是根据情况确定(或者叫“测量”)你绘制的内容应该多大。

官方文档

This is called during layout when the size of this view has changed. If you were just added to the view hierarchy, you're called with the old values of 0.

在布局期间,当视图的大小被改变的时候这个会被调用。如果视图是刚刚添加到视图层级中,旧的值会是0。

Dominant language
Java
Stars
9.3k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GcsSloop/AndroidNote

All issues in GcsSloop/AndroidNote

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.