I am new to Gridlayout
in android, but i create a layout which looks fine on preview screens but when i run it on real device all items gets compressed and get aligned to top-left of screen
This layout is perfect when we see preview on android studio or eclipse with all items having equally stretched or width but on real device it gets compressed to left of layout
My xml is as follows,i need help in sortring out this error:-
<?xml version="1.0" encoding="utf-8"?>
<GridLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:useDefaultMargins="true"
android:background="@drawable/backgournd_cancel"
android:columnCount="4">
<TextView
style="@style/style_textView_marquee"
android:layout_columnSpan="4"
android:text="Vikramaa" />
<ImageView
style="@style/style_imageView"
android:layout_columnSpan="1"
android:layout_columnWeight="1"
android:src="@drawable/ic_launcher" />
<ImageView
style="@style/style_imageView"
android:layout_columnSpan="1"
android:layout_columnWeight="1"
android:src="@drawable/edit_pressed" />
<ImageView
style="@style/style_imageView"
android:layout_columnSpan="1"
android:layout_columnWeight="1"
android:src="@drawable/heart_normal" />
<ImageView
style="@style/style_imageView"
android:layout_columnSpan="1"
android:layout_columnWeight="1"
android:src="@drawable/open_pressed" />
</GridLayout>