Kotlin and Android Development featuring Jetpack : No complete explanation on 0dp

Please use the following format for the title of this thread (then simply delete/replace this text with the content for the thread):

Title: Kotlin and Android Development featuring Jetpack - 0dp explained or not? (page 21)

0dp is pointed out to be explained, yet with an explanation of dp as “a certain number of density-independent pixels”, author didn’t finish with the meaning of 0dp, does it mean zero density-independent pixel at all?

Please also add the book’s tag if it has not already present, thanks!

Hi there!
After the first time 0dp is mentioned, the next sentence is the explanation:

That turns the responsibility of sizing the view over to the .

In other words, setting something to 0dp means the assigned constraints will handle the sizing for the component. Or, if the constraints are not there, the component actually has no size.

Hope this helps!

Oh, that helped a lot!

1 Like

Great, thanks for checking in!