Sidedrawer icon is not able to fix


#1

Hi,
i want sidedrawer button on actionbar…i use Icon font but it is not able to set on the left side where sidedrawer button usuall sees…
i download sidedrawer image from
https://material.io/icons/
and i placed the icons in my applications android folder…but not getting…then i copy into image folder and try to acess it but i get small size…

anyone help me for to solve the issue

How to place sidedrawer icon in actionbar ?


#2

If you want to use font icon in ActionBar, you will have to customize the title view in android. Here is an example how yo can do that https://docs.nativescript.org/ui/action-bar#using-a-custom-title-view

You can use system defined icons or if you want to use a custom image place the images in respective density specific folders (if you don’t want to place images for each density, you can at least consider placing one with right dimension in the highest which could be xdpi or xxxdpi).


#3

sorry …i am not understand the answer…when i use font icon in left side it will comes in center…and also…not able to fix logo and font icon combinely…this is my action bar ,
<ActionBar title=“Today”
<Label text=“Today” class=“AB_name” </Label
<Image src="~/images/logo.png" stretch=“none” horizontalAlignment=“center” class=“AB_logo”</Image
</ActionBar

this is my CSS ,

.AB_logo {
margin-left:220;
}
.AB_name {
font-size: 20;
margin-left:20;
}

how to make font icon on left side and logo on right side


#4

You have to wrap them inside a layout. Exact example is there in docs in the given link.

<ActionBar title="test">
  <StackLayout orientation="horizontal"
    ios:horizontalAlignment="center"
    android:horizontalAlignment="left">
    <Image src="res://nativescript_logo" class="action-image"></Image>
    <Label text="ativeScript"  class="action-label"></Label>
  </StackLayout>
</ActionBar>

#5

yup… now its working