왜 왼쪽 공간에서 왼쪽의 선형 레이아웃?

0

질문

immage of android studio design

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/myToolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#019032"
                android:padding="20dp"
                android:gravity="center_horizontal">

                <ImageView
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:layout_marginLeft="0dp"
                    android:paddingLeft="0dp"
                    android:src="@drawable/menu" />

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_gravity="center"
                    android:textAlignment="center"
                    android:layout_weight="1"
                    android:textStyle="bold"
                    android:textSize="18dp"
                    android:text="Falesie in Italia" />

                <ImageView
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:src="@drawable/menu" />

            </LinearLayout>

        </androidx.appcompat.widget.Toolbar>

</androidx.constraintlayout.widget.ConstraintLayout>

나를 추가하려는 도구 모음에서 응용과 작은 공간에서 왼쪽의 선형 레이아웃이 있습니다.

이 코드 내 주요 활동 레이아웃을 변경하려고 패딩과 여백의 모든 요소이지만 상황 doasn 있습니다.

사람이 왜 알고 있나요?

2

최고의 응답

1

할 수 있도

 app:contentInsetLeft="0dp"
 app:contentInsetStart="0dp"
 android:padding="0dp"

그것은 다음과 같이 될 것이다

<androidx.appcompat.widget.Toolbar
    android:id="@+id/myToolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:contentInsetLeft="0dp"
    app:contentInsetStart="0dp"
    android:padding="0dp">
2021-11-24 05:01:24
0

미리보기에서 내 안드로이드 스튜디오 문제와 캐시

  • 파일을 복사 컨텐츠
  • 파일이 삭제
  • 파일>무효화&를 다시 시작
  • Gradle sync
  • 새 파일 만들기와 다른 이름
  • 체크인 미리보기
  • 응용 프로그램을 실행하고 확인
  • 이름 바꾸기를 원래 이름

이 작업

  • 가까운로드 완전히 스튜디오 (을 확인 작업 관리자와 작업하는 경우 그간)
  • 입력 %USERPROFILE%\.gradle\caches 탐색기에서 삭제 캐시 폴더 enter image description here
  • 귀하의 프로젝트 루트와 삭제 .idea, .gradlebuild폴더 enter image description here
  • 방 안드로이드 스튜디오
2021-11-24 04:54:05

안녕 Omka,다만의 단계별로 솔루션을 가지고 있지만 여전히 문제입니다.
imaluris

보십시오 업데이트된 응답
Omkar T

문제와 기본값의 도구 모음으로@imaluris 고 말했다 나타나는 또한 응용 프로그램에서 뿐만 아니라 미리보기를 그렇다는 것을 의미하는 문제되지 않는 구조를 가진 파일에는 필요에만 설정의 기본값으로 패딩과 콘텐츠를 삽입 0 나 그는해야하는 공간을 제어
Ahmed Karam

안녕하세요,사람을 내가 순간적으로 해결을 추가하여 안드로이드:layout_marginLeft="-20dp"에서 도구 모음 항목입니다.
imaluris

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................