2017-11-03 11 views
0

프레임 레이아웃의 오른쪽에 선형 레이아웃을 배치하려고합니다. , FrameLayout 오른쪽의 LinearLayout

<LinearLayout 
android:layout_width="wrap_content" 
android:layout_height="match_parent" 
android:orientation="horizontal"> 
<FrameLayout 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent"> 
    <ArmgaSys.ConDoc.Droid.Views.DrawingImageView 
    android:id="@+id/plan_markup_image" 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" /> 
    <SkiaSharp.Views.Android.SKCanvasView 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:id="@+id/plan_markup_canvas" /> 
    <LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:orientation="horizontal" 
    android:gravity="bottom"> 
    <TextView 
     android:id="@+id/planMarkupMessage" 
     android:text="Touch and drag to" 
     android:textAppearance="?android:attr/textAppearanceSmall" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="#ffffff" 
     android:textColor="#000000" 
     android:textAlignment="center" 
     android:gravity="center" /> 
    </LinearLayout> 
</FrameLayout> 
<LinearLayout 
    android:layout_width="250dp" 
    android:layout_height="match_parent" 
    android:background="#888888"> 
    <TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="This is my text"/> 
</LinearLayout> 

그러나, 선형 레이아웃이 표시되지 않습니다 나는 화면을 강요 당하고 있다고 생각 :

내 레이아웃에 다음 코드가 서로 옆을 설정하는 것입니다.

다양한 너비/높이의 wrap_content와 match_parent 조합을 시도했지만 상황이 제대로 작동하지 않습니다. 나는 또한 으로 작업 한 프레임 레이아웃 내부에 (그러나 끝에) 선형 레이아웃을 넣으려고했지만 'ArmgaSys.ConDoc.Droid.Views.DrawingImageView'구성 요소의 가장자리를 잘라 냈습니다.

프레임 레이아웃과 선형 레이아웃을 서로 겹쳐서 화면과 겹치거나 화면이 벗어나지 않게하려면 어떻게해야합니까? 여기

편집 이 당신이 원하는 무엇을 전체 레이아웃 코드

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 
    <android.support.design.widget.AppBarLayout 
     android:id="@+id/app_bar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:theme="@style/AppTheme.AppBarOverlay"> 
     <include 
      layout="@layout/widget_toolbar" /> 
     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 
      <ArmgaSys.ConDoc.Droid.Views.UIColoredSpinner 
       android:id="@+id/drawing_tools" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:popupTheme="@style/AppTheme.PopupOverlay" 
       app:popupTheme="@style/AppTheme.PopupOverlay" /> 
      <Space 
       android:layout_width="0dp" 
       android:layout_height="match_parent" 
       android:layout_weight="1" /> 
      <Button 
       android:id="@+id/plan_markup_undo" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Undo" /> 
      <Button 
       android:id="@+id/plan_markup_continue" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Continue" /> 
     </LinearLayout> 
    </android.support.design.widget.AppBarLayout> 
    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:orientation="horizontal"> 
     <FrameLayout 
      android:layout_width="wrap_content" 
      android:layout_height="match_parent"> 
      <ArmgaSys.ConDoc.Droid.Views.DrawingImageView 
       android:id="@+id/plan_markup_image" 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" /> 
      <SkiaSharp.Views.Android.SKCanvasView 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:id="@+id/plan_markup_canvas" /> 
      <LinearLayout 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:gravity="bottom"> 
       <TextView 
        android:id="@+id/planMarkupMessage" 
        android:text="Touch and drag to" 
        android:textAppearance="?android:attr/textAppearanceSmall" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:background="#ffffff" 
        android:textColor="#000000" 
        android:textAlignment="center" 
        android:gravity="center" /> 
      </LinearLayout> 
      <LinearLayout 
       android:layout_width="250dp" 
       android:layout_height="match_parent" 
       android:layout_gravity="right" 
       android:background="@color/primary_light"> 
       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="This is my text" /> 
      </LinearLayout> 
    </FrameLayout> 
</LinearLayout> 
</LinearLayout> 

답변

0

입니까?

<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical"> 

<android.support.design.widget.AppBarLayout 
    android:id="@+id/app_bar" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <include 
     layout="@layout/widget_toolbar" /> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 

     <ArmgaSys.ConDoc.Droid.Views.UIColoredSpinner 
      android:id="@+id/drawing_tools" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:popupTheme="@style/AppTheme.PopupOverlay" 
      app:popupTheme="@style/AppTheme.PopupOverlay" /> 

     <Space 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:layout_weight="1"/> 

     <Button 
      android:id="@+id/plan_markup_undo" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Undo"/> 

     <Button 
      android:id="@+id/plan_markup_continue" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Continue"/> 

    </LinearLayout> 

</android.support.design.widget.AppBarLayout> 

<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:gravity="end" 
    android:orientation="horizontal"> 

    <RelativeLayout 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent"> 

     <ArmgaSys.ConDoc.Droid.Views.DrawingImageView 
      android:id="@+id/plan_markup_image" 
      android:layout_width="wrap_content" 
      android:layout_height="match_parent" /> 

     <SkiaSharp.Views.Android.SKCanvasView 
      android:layout_width="wrap_content" 
      android:layout_height="match_parent" 
      android:id="@+id/plan_markup_canvas" /> 

     <TextView 
      android:id="@+id/planMarkupMessage" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:background="#ffffff" 
      android:gravity="center" 
      android:text="Touch and drag to" 
      android:textAlignment="center" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:textColor="#000000"/> 

    </RelativeLayout> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/primary"> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="This is my text"/> 

    </LinearLayout> 

</LinearLayout> 

I했습니다 단지 아버지 match_parent를 넣어, 나는 match_parent 그의 아버지에게 자녀의 LinearLayout 조정했습니다.

[편집] LinearLayout 부모에서 중력을 끝내고 LinearLayout 하위에 wrap_content 너비가 있습니다.

+0

플러스 거기에 더 이상'FrameLayout' ... – kalabalik

+0

내가 뭘 원하는지 이해가 안 돼,이 방법은 아무것도 화면에서 벗어나. 제발, 네가 원하는 걸 더 잘 설명 할 수 있니? –

+0

Daniel, 답변 해 주셔서 감사합니다. 내가 제안한 코드를 시도했지만 오른쪽 메뉴 (선형 레이아웃)가 누락 된 것 같습니다. 나는 원래의 질문을 전체 레이아웃 코드로 업데이트하여 정확히 내가하고있는 것을 볼 수있다. 다음은 제안한 코드가 생성 한 이미지입니다. https://ibb.co/isEuNb –