Layout_gravity center along with layout_marginRight question
I cannot get the reason there is a difference in the two views, only the difference is layout_gravity Center is missing in the second
<?xml version="1.0" encoding="utf-8"?>
<View
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_gravity="top|center"
android:layout_height="10dp"
android:layout_marginRight="100dp"
android:background="@android:color/holo_red_dark"
/>
<?xml version="1.0" encoding="utf-8"?>
<View
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_gravity="top"
android:layout_height="10dp"
android:layout_marginRight="100dp"
android:background="@android:color/holo_red_dark"
/>
0
source to share
2 answers
here are my questions.
The reason for the extra 8dp difference in performance? not solutions
there is an underline under my words ..
- I pictured it as a view with a black background.
- with leftmargin 48dp.
- but as you can see there is an additional 8dp.
- I'm looking for the real reason.
- there is no other way to figure it out.
- check my link for more information.
-1
source to share