1

Let's say I prefer using "dp" rather than "fill_parent" or "wrap_content", what would be the appropriate number to use in order to fill the screen with a picture?

user858975
  • 233
  • 1
  • 7
  • 17

2 Answers2

2

This depends of the screen and of its density. Check this article to learn more about that.

(This may lead you to reconsider using fill_parent / wrap_content by the way).

Shlublu
  • 10,917
  • 4
  • 51
  • 70
1

Why would you "prefer" this? Precise dp values for layout_width/layout_height are one tool alongside match_parent and wrap_content and building a nice UI will usually involve all three. Which one is appropriate for each dimension of any given View is situational and match_parent's entire reason for existence is to match the size of a View's container, in your case the screen.

(* match_parent is the newer name for fill_parent.)

adamp
  • 28,862
  • 9
  • 81
  • 69