RelativeLayout ..ImageView schwebt zu weit über dem Boden

  • Antworten:5
Mac Systems
  • Forum-Beiträge: 1.727

17.12.2010, 11:52:32 via Website

Hier eine kleine Test XML:

1<?xml version="1.0" encoding="utf-8"?>
2<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="wrap_content" android:layout_height="wrap_content"
4 android:background="#269">
5
6 <ImageView android:layout_width="wrap_content"
7 android:layout_height="wrap_content"
8 android:layout_alignParentBottom="true" android:src="@drawable/hand" android:layout_gravity="bottom"/>
9</RelativeLayout>
Leider schwebt der ImageView ein ganzes Stück über dem "Bottom". Wie muss Ich das ändern damit es komplett am parent Boden klebt ?

Danke,
Mac

— geändert am 17.12.2010, 11:56:56

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten
Mac Systems
  • Forum-Beiträge: 1.727

17.12.2010, 12:18:25 via Website

Nutzte Ich stattdessen einen Button bekomme Ich das Ergebnis wie gewollt, wo ist denn jetzt das Problem? Total Unlogisch!

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten
Markus Gu
  • Forum-Beiträge: 2.644

17.12.2010, 12:19:30 via Website

hat dein image vielleicht einen transparenten rand?

swordiApps Blog - Website

Antworten
Mac Systems
  • Forum-Beiträge: 1.727

17.12.2010, 12:29:16 via Website

Nein! Probiers einfach mal aus!

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten
Mac Systems
  • Forum-Beiträge: 1.727

17.12.2010, 12:36:31 via Website

Ich habe das Bild im Hdpi Ordner abgelegt, es ist 652x652 von der dimension, verkleinere Ich dieses (420x420) wird es unten dargestellt. Irgendwie kann Ich mit diesem Verhalten nichts anfangen. Der Emulator ist auf 480x800 eingestellt in der API Version 8 (2.2). Bisher hatte Ich nie dieses Problem, Android Skaliert auch die Bilder entsprechend, das 652x652 Bild wird ja auch korrekt dargestellt nur eben zu hoch. Hab Ich etwas nicht verstanden ?

— geändert am 17.12.2010, 12:45:17

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten
Gian U.
  • Forum-Beiträge: 117

17.12.2010, 18:48:35 via Website

1<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2 android:layout_width="fill_parent" android:layout_height="fill_parent"
3 android:background="#269">

Versuchs mal so, d.h. die Höhe und Breite des Layouts auf "fill_parent" umstellen.

Mnemono - Efficient learning!

Antworten