Layout on the right side
I am working on my first app, and I created spinner using this tutorial:
http://www.androidbegin.com/tutorial/actionbarsherlock-custom-menu-list-navigation-fragments/
... everything is just fine, but how to set right align to that spinner?
Is it even possible? I want to change align using XML, but if only
solution is java code, then it is okay.
I have tried so many times, and always with fail. Somebody have said that
if you create list navigation with custom adapter and views, you can set
right align, but how?
In nav_list_item.xml instead of LinearLayout, I have tried RelativeLayout
with some gravity properties:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical|right"
android:layout_gravity="center_vertical|right"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
style="?attr/spinnerItemStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="right|center_horizontal"
android:paddingLeft="0dp"
android:singleLine="true" />
</RelativeLayout>
... unfortunately without success.
No comments:
Post a Comment