-1

フラグメントの上にこのtextViewを有効にするにはどうしたらいいですか?私はそれが断片がお互いから変わっても静的にしておきたい。 Iamはそれを可能にする運がない。ここに私のレイアウトがあるフラグメント上のtextViewを有効にする

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 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:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context="com.example.skwebviewapp.MainActivity"> 

    <fragment 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:id="@+id/mainFragment" 
     tools:layout="@layout/fragment_main" /> 
    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="16dp" 
     android:id="@+id/textView" 
     android:text="@string/app_name"/> 
</LinearLayout> 

答えて

0

これは、フラグメント内でそれを置く

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 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:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context="com.example.skwebviewapp.MainActivity” 
    android:orientation=“vertical" 
    android:weightSum=“1.0"> 


    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height=“0dp” 
     android:layout_weight=“0.10" 
     android:id="@+id/textView" 
     android:text="@string/app_name”/> 


    <fragment 
     android:layout_width="match_parent" 
     android:layout_height=“0dp" 
     android:layout_weight=“0.90" 
     android:id="@+id/mainFragment" 
     tools:layout="@layout/fragment_main" /> 

</LinearLayout> 
0
You can try this with RelativeLayout. 

    <?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 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:orientation="vertical"> 


    <TextView 
     android:id="@+id/textView" 
     android:layout_width="match_parent" 
     android:layout_height="16dp" 
     android:text="@string/app_name" /> 

    <fragment xmlns:map="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/map_view_fargment" 
     android:name="com.google.android.gms.maps.MapFragment" 
     class="com.google.android.gms.maps.MapFragment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_marginTop="40dp" 
     /> 


</LinearLayout> 
+0

、コードの下に試してみてください。フラグメントの上に表示したい – ryhan112

+0

私は今このチェックを編集しました。 –

+0

は現在修正されています。ありがとう。 – ryhan112

関連する問題