Issue
I have seen some people using sp for margins like:
android:layout_marginLeft="40sp"
While many have been using dp, like:
android:layout_marginLeft="40dp"
Could anyone please confirm which is better between these two and which should be used when? Any help would be highly appreciated.
Solution
sp
for font sizes, dp
for everything else. sp
stands for Scale-independent Pixels, dp
stands for dip
=density independent pixels. Detailed explanation
Answered By - Mustafa Berkay Mutlu
Answer Checked By - Willingham (JavaFixing Volunteer)