Problems with search bar space/button position (edited)


#1

Hey:) I have a problem I implemented a search bar and now there is a space between the bar and the content (profiles). How can I get rid of this space? I know there should be the Items to be searched, but I have other items, the profiles. Do I have to implement them there, where the space is.

How can I position the green button on the right side, central. I tried it with margin but that didn’t work.

Thanks in Advance

Here the code:


<ion-header>
  <ion-navbar color="rank">
    <ion-title>
      friends
    </ion-title>
  </ion-navbar>
</ion-header>

<ion-content>

  <ion-content>
  <ion-searchbar (ionInput)="getItems($event)"></ion-searchbar>
  <ion-list>
    <ion-item *ngFor="let item of items">
      {{ item }}
    </ion-item>
  </ion-list>
</ion-content>

  
<ion-list>
  <ion-item>
    
 <button ion-button color="rank" round>Add </button>
    <ion-avatar item-start>
      <img src="img/fri.jpg">
    </ion-avatar>
    <h1>JanePrincess</h1>
    <h3>Iceland, Reykjavik </h3>



   
  </ion-item>

   <ion-item>
    <ion-avatar item-start>
      <img src="img/hot.jpg">
    </ion-avatar>
    <h1>Dean</h1>
    <h3>Iceland, Reykjavik </h3>


   
  </ion-item>

   <ion-item>
    <ion-avatar item-start>
      <img src="img/top.jpg">
    </ion-avatar>
    <h1>Wayne</h1>
    <h3>Iceland, Reykjavik </h3>


   
  </ion-item>

   <ion-item>
    <ion-avatar item-start>
      <img src="img/loc.jpg">
    </ion-avatar>
    <h1>Pieii</h1>
    <h3>Iceland, Reykjavik </h3>


   
  </ion-item>

   <ion-item>
    <ion-avatar item-start>
      <img src="img/top.jpg">
    </ion-avatar>
    <h1>Dude</h1>
    <h3>Iceland, Reykjavik </h3>


   
  </ion-item>

   <ion-item>
    <ion-avatar item-start>
      <img src="img/fri.jpg">
    </ion-avatar>
    <h1>de9md</h1>
    <h3>Iceland, Reykjavik </h3>


   
  </ion-item>

</ion-list>

</ion-content>


import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

@Component({
  selector: 'lions-home',
  templateUrl: 'lions.html'
})
export class LionsPage {
  items;

  constructor(public navCtrl: NavController) {
    this.initializeItems();

  }

initializeItems() {
  this.items = [

  ];

}

getItems(ev) {
    // Reset items back to all of the items
    this.initializeItems();

    // set val to the value of the ev target
    var val = ev.target.value;

    // if the value is an empty string don't filter the items
    if (val && val.trim() != '') {
      this.items = this.items.filter((item) => {
        return (item.toLowerCase().indexOf(val.toLowerCase()) > -1);
      })
}
}
}

Photos of the “space” in the built: