I want something like this:
i using android relativelayout and this is a tag like: android: layout_centerHorizontal = "true" and this gives me the following:
i player with other tags and combine them, but will fail.
is there any way to do this?
Try the following:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:id="@+id/linearLayout1" android:layout_width="20dp" android:layout_height="match_parent" android:layout_centerHorizontal="true" android:background="@android:color/black" > </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@+id/linearLayout1" android:text="YOUR TEXT" /> </RelativeLayout>
try it
<RelativeLayout android:layout_width="fill_parent" android:background="#FFFFFF" android:layout_height="wrap_content"> <View android:layout_width="10dp" android:layout_height="1dp" android:layout_centerInParent="true" android:id="@+id/dummy" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="SDADASd" android:layout_centerVertical="true" android:layout_toRightOf="@id/dummy" android:textColor="#000000" /> </RelativeLayout>
or go with linearlayout... <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:id="@+id/linearLayout1" android:layout_width="0dp" android:layout_height="match_parent" android:gravity="right" android:layout_weight="1" > <View android:layout_width="10dp" android:background="@android:color/black" android:layout_height="match_parent"/> </LinearLayout> <TextView android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:layout_toRightOf="@+id/linearLayout1" android:text="YOUR TEXT" /> </LinearLayout>
Add a transparent view to the center of your RelativeLayout and
height="match_parent" width="15dp"//(it doesn't matter much)
then specify the layout parameter relative to this view, for example
android:layout_alignRight="@+id/yourView"
Source: https://habr.com/ru/post/1501610/More articles:Compatibility iPhone OpenGL ES 2.0 with Cocos2D gives unexpected results - iphoneHow to detect that textDidChange: on a UISearchBar was caused by dictation - iosHow can I get regex matching positions in ClojureScript? - regexhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1501608/libgdx-shader-working-on-desktop-but-not-on-android&usg=ALkJrhiyipZnHf6ip7zmpALiXgdFyi355wfor-loop in shader code working with hard code but not with a homogeneous variable - androidAndroid application does not close after calling System.exit (0) - androidBoth relate to the columns in the Model - sqlBetween more than 30 days and less than 90 days - sql-server-2008udp didReceiveData gets two times - iphoneClosing an application is not easy at all - javaAll Articles