Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] android – how can i postion the text in bottom left in the drawer header and reduce the drawer header height?

Posted on November 11, 2022 By

Solution 1 :

You can just wrap your Text widget in a container that aligns it.
To change the size of the header just add another container around the Header that sets the height.

new Drawer(
        child: ListView(
          children: <Widget>[
            Container(
              child: new DrawerHeader(
                child: Container(
                  child: Text("Drawer Header"),
                  alignment: Alignment.bottomLeft, // <-- ALIGNMENT
                  height: 10,
                ),
                decoration: BoxDecoration(color: Colors.blueGrey),
              ),
                height: 50,      // <-- HEIGHT
            )
          ],
        ),
      ),

Solution 2 :

just wrap your DrawerHeader with a SizedBox

and wrap your Text with a Align widget

drawer: Drawer
      (
        child: ListView
        (
          children: <Widget>
          [
            SizedBox(
              height: 150,
              child: DrawerHeader
            (
              child: Align(
                alignment: Alignment.bottomLeft,
                child: Text("Drawer Header")
              ),
              decoration: BoxDecoration
              (
                color: Colors.blueGrey
              ),
            )
            )
          ],
        ),
      ),

Problem :

So i just want to postion the text in the bottom left of the drawer header and also reduce the height of the drawer header

drawer: new Drawer
      (
        child: ListView
        (
          children: <Widget>
          [
            new DrawerHeader
            (
              child: Text("Drawer Header"),
              decoration: BoxDecoration
              (
                color: Colors.blueGrey
              ),
            )
          ],
        ),
      ),

enter image description here

READ  [FIXED] android - How to Implement or Handle the CountDownTimer using Kotlin Coroutines
Powered by Inline Related Posts
Android Tags:android, flutter

Post navigation

Previous Post: [FIXED] android – Can you get the tag of a date picker
Next Post: [FIXED] Android Recyclerview add item and notifyiteminserted causes blink recycled view before draw the correct

Related Posts

[FIXED] android – How can i make a progress bar with tracker and percent? Android
[FIXED] kotlin – Setting Default orientation to landscape in jetpack compose? Android
[FIXED] How can I achieve the “wake up screen and go to Activity” behavior of the Android alarm clock app? Android
[FIXED] firebase – Android application with different build type having same package name Android
[FIXED] java – Integer cannot be cast to Long Android
[FIXED] java – Two apps communicating using Intent, passing data Android

Archives

  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • Can Vicks humidifier be used without filter?
  • What color is Spanish green?
  • How old is Jamie in The War That Saved My Life?
  • When should I use scalp massager for hair growth?
  • Can I put polyurethane over liming wax?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme