android - RelativeLayout width in a custom info window for API Maps v2 -


i have custom info window google maps api v2 uses relativelayout added overwritting getinfowindow in class. layout has textview title in first line , 3 textviews in next line, 1 aligned left, center , thrid 1 right. works, window takes whole of screen, ugly in big screens tablets.

i have tried set width of relativelayout fixed value (let's "50dp") or "wrap_content", takes whole of screen.

this xml layout:

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/bus_stop_info_window"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:background="#ffffffff" >      <textview         android:id="@+id/title"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="left"         android:text="a title" >     </textview>      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_below="@id/title"         android:gravity="left"         android:text="test1" >     </textview>      <textview         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_below="@id/title"         android:gravity="center"         android:text="test2" >     </textview>      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_below="@id/title"         android:gravity="left"         android:text="test3" >     </textview>  </relativelayout> 

how can achieve desired effect?

for make root element linear-layout , put relative-layout inside it.so window not fill whole screen in tablet.this not affect whether relative-layout width wrap_content or fixed size.

u can try answer here


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -