지금 Android 앱을 만들고 있는데 셸에 조각이 들어 있습니다. 지금까지는 모든 것이 잘 작동하지만, 나는 완전히 이해할 수없는 질문에 왔습니다.Android Fragments : 프레임 또는 다른 레이아웃 내의 조각?
전체 화면 (FrameLayout - 기본 프레임으로 FrameLayout을 사용해야합니까?) 인 Frame이 있으며이 프레임 내부에는 사용자 상호 작용에 따라 변경되는 부분이 있습니다. 이러한 조각은 .xml 파일의 FrameLayouts에 있습니다. FrameLayouts 또는 조각이 될 수 있는지 여부를 궁금해합니다 ... 나는 이상적인 조각 인 Google지도 frredge를 만들어서 생각하게 만들었습니다.
그럼 내 질문은 다음과 같습니다. 차이가 있거나 성능에 어떤 영향을 주나요? 아니면 용도가 무엇이든간에 간단하게 사용할 수 있습니까? 합니다 (FrameLayout이 내부 조각을 모두 넣을 수있는 FrameLayout이 내부)
메인 프레임 (activity_main.xml) :
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
tools:ignore="MergeRootFrame" >
<FrameLayout
android:id = "@+id/mainFrame"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
android:layout_marginBottom = "@dimen/bottom_Main_Tabs">
</FrameLayout>
<LinearLayout
android:layout_width = "match_parent"
android:layout_height = "@dimen/bottom_Main_Tabs"
android:layout_gravity = "bottom"
android:background="@color/grey2"
>
<ImageButton
android:id = "@+id/bottomButton_home"
android:layout_height = "match_parent"
android:layout_width = "0dp"
android:layout_weight = "1.0"
android:layout_marginLeft = "2dp"
android:layout_marginRight = "2dp"
android:background = "@drawable/ic_home_white"
android:onClick = "openHome"
/>
[...]
</LinearLayout>
<RelativeLayout
android:id = "@+id/TopBar"
android:layout_width = "match_parent"
android:layout_height = "@dimen/top_Bar_Hight"
android:layout_gravity="top"
android:background="@color/grey_transparentBy50"
>
<ImageView
android:id= "@+id/TopBarLogo"
android:layout_width = "@dimen/top_Bar_Hight"
android:layout_height = "@dimen/top_Bar_Hight"
android:background="@drawable/ic_launcher"
/>
[...]
</RelativeLayout>
</FrameLayout>
한 조각 (
가 무슨 뜻인지 보여주기 위해 여기에 몇 가지 코드 샘플은 FrameLayout이 :)
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/home_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/blue"
tools:context="com.domain.app.HomeFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:textSize="100sp"
android:text="Home" />
</FrameLayout>
다른 Frament (단편)
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/map"
tools:context="com.domain.app.MapsActivity"
android:name="com.google.android.gms.maps.MapFragment"
tools:layout = "@layout/activity_main"
/>
GoogleMaps 구현에 문제가 너무 많지만 아직 도움을 요청할 시간이 부족합니다.
미리 감사드립니다.
존
xml 파일 콘텐츠를 붙여 넣을 수 있습니까? – aldorain
질문이 업데이트되었습니다. – JRsz