Open YKW93 opened 5 years ago
The segmented control algorithm for layout do not support such a case, however this could be achieved with some little hacking ...
Here is the result
Wrap parent RelativeLayout in circle_text_segment.xml with FrameLayout as shown below
<FrameLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:layout_width="65dp"
android:layout_height="65dp">
<ImageView
android:id="@+id/civ_fuel_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:src="@android:color/white"/>
<TextView
android:id="@+id/tv_fuel_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:textSize="14sp"/>
</RelativeLayout>
</FrameLayout>
columnCount = 4 segmentItemCount = 6
In this case, how do I align to the left?
For now layouting algorithm doesn't support such a case, I will try to add support for this
I want to align the data 11 to the left. how to align?
[Segment item xml] <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:layout_marginBottom="5dp">
[Adapter class]
[color setting]
[SegmentedControl]