저는 단편의 일부인 레이아웃 섹션과 활동을위한 레이아웃을 가지고 있습니다.일반적인 활동 및 단편화 방법
fragment.xml
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none”>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp">
<include layout="@layout/sectional_component"/>
<include layout="@layout/list_component" />
<include layout="@layout/usage_component" />
</RelativeLayout>
</ScrollView>
list_component.xml
<LinearLayout
android:id="@+id/list"
style="@style/VerticalMatchParent">
// programatically added top 3 customer list
</LinearLayout>
activity_list.xml
<LinearLayout
android:id="@+id/list"
style="@style/VerticalMatchParent">
// programmatically render all customer list
</LinearLayout>
나는 안드로이드에 새로운 해요. 요청 (3 또는 모두)을 기반으로 목록을 렌더링하는 데 일반적인 방법을 사용하고자했습니다. 지금은 Fragment와이를 처리하기위한 활동에 별도의 메소드를 작성했습니다. 기능이 거의 동일하므로 단편뿐만 아니라 활동에서도 사용할 수있는 단일 메소드로 만들고 싶습니다. 나는 그것을 별도의 util 메서드로 만들려고했지만, 내가 직면하고있는 문제는 뷰 요소에 대한 조작을 수행하는 메서드 내부에 있으며 뷰 요소 레이아웃을 부 풀리지 않고 어떻게해야하는지 잘 모르는 경우입니다. 이미 뷰 요소가있는 레이아웃은 각 단편과 활동에서 부풀려집니다.
이 문제에 대한 해결책을 제공하십시오.
당신은 그 방법을 공유 할 수 있습니까 –