Chcę utworzyć następujący ekran w systemie Android. Układ okrągły
Użyłem CircleLayout, ale nadal nie jestem w stanie osiągnąć pożądanej wydajności. Zobacz poniższy kod i zrzut ekranu.
<com.example.hl.CircleLayout
android:id="@+id/pie"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
custom:dividerWidth="5dp"
custom:innerCircle="@drawable/profile_pic_icon"
custom:innerRadius="50dp"
custom:layoutMode="pie"
custom:sliceDivider="@android:color/transparent" >
<RelativeLayout
android:id="@+id/appt_center_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/appt_center_bg" >
<TextView
android:id="@+id/one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:onClick="onClick"
android:text="APP CENTER"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/meds_cabinet_bg" >
<TextView
android:id="@+id/two"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="onClick"
android:text="MEDS CABINET"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/check_in_bg" >
<TextView
android:id="@+id/three"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="onClick"
android:text="CHECK-IN"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/my_tracker_bg" >
<TextView
android:id="@+id/four"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="onClick"
android:text="MY TRACKERS"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/myaccount_bg" >
<TextView
android:id="@+id/five"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="onClick"
android:text="MY ACCOUNTS"
android:textStyle="bold" />
</RelativeLayout>
</com.example.hl.CircleLayout>
screenshot
Pytanie: -
Czy istnieją inne biblioteki, które mogą pomóc w rozwijaniu żądany ekran?
Jak stworzyć taki ekran za pomocą niestandardowego widoku? Chodzi mi o to, jakie są kroki, aby łatwo stworzyć taki niestandardowy widok?
Prawdopodobnie użyć przestarzałej AbsoluteLayout i wykonywać wszystkie X, Y obliczenia różnych przycisków siebie w stosunku do całkowitej dostępnej wielkości. Pamiętaj, aby ponownie skalować wszystkie pozycje przy zmianie rozmiaru. – talkol
Czy sprawdziłeś przykładowy projekt? Pierwszą różnicą, jaką widzę, jest to, że wszystkie bezpośrednie dzieci 'CircleLayout' mają' match_parent' dla wysokości/szerokości, podczas gdy twoje nie. Przejdź przez to i naśladuj przykład najlepiej jak potrafisz, a następnie sprawdź, czy zbliża się do ciebie. Nawiasem mówiąc, "Czy istnieje inna biblioteka ..." jest tutaj tematem nietypowym, a twoje drugie pytanie jest zbyt szerokie. Pozostanę przy "Jak mogę naprawić ten CircleLayout ...". – Geobits
@ becomputer06 Czy rozwiązałeś problem? – SeniorJD