-1

I have created a grid layout Like this:

I have created A Grid Layout Like this

But I want my grid layout some thing like this:

But I Want My grid Layout some thing like this

I want my text to be appear on right side. Like Contacts List. Please tell me what changes I must have to do in my layout file. Waiting for a good response.

TrebledJ
  • 8,713
  • 7
  • 26
  • 48
Asmat
  • 37
  • 1
  • 12
  • Thanks @TrebuchetMs for correcting me... – Asmat Nov 25 '18 at 11:26
  • No worries, part of the moderation process. I can forsee downvotes going your way due to [images of code](http://idownvotedbecau.se/imageofcode). I suggest you [copy-paste your code into your question](https://stackoverflow.com/posts/53466860/edit) and [format it](https://meta.stackexchange.com/questions/22186/how-do-i-format-my-code-blocks) to make it presentable. :-) – TrebledJ Nov 25 '18 at 11:30
  • @TrebuchetMS Sorry for inconvenience, i am new to stack overflow. And this is my first question. So i am not much familiar with rules & regulations of stack overflow. Next time will keep this in mind. – Asmat Nov 25 '18 at 11:49

3 Answers3

1

Since you seem to want a list and not a grid, you should use a LinearLayoutManager, not a GridLayoutManager.

See the official documentation for examples.

Ridcully
  • 23,362
  • 7
  • 71
  • 86
0

Try changing the orientation of your linerlayout to horizontal.

Jan. St.
  • 31
  • 4
-1

this the xml code just copy and past

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/android_list_view_tutorial_with_example"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="5dp">

<ImageView
    android:id="@+id/album"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:contentDescription="@string/app_name"
    android:padding="5dp"
    android:src="@drawable/pic1" />

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="YOUR TEXT"
    android:id="@+id/album_title">
</TextView>
</LinearLayout>
Abdomns
  • 428
  • 3
  • 8