BackgroundRepeat Problem

  • Antworten:22
Maximilian O
  • Forum-Beiträge: 990

09.01.2012, 16:51:56 via Website

Heyho Leute,
ich brauche eure Hilfe :)

In meiner App setze ich eine xml als Hintergrund. Diese sieht so aus:
1<?xml version="1.0" encoding="utf-8"?>
2<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
3 android:src="@drawable/app_background"
4 android:tileMode="repeat" />

Wir ihr oben sehen könnt, multipliziert sie eine Grafik um den Hintergrund zu füllen. Das klappt auch fast immer.
Doch manchmal eben nicht, dann wird einfach die kleine Grafik auf den ganzen Bildschirm hochskaliert (und eben nicht repeated).

Kennt ihr das Phänomen? Wisst ihr was man dagegen machen kann?

MfG Maximilian

Vergiss nie wieder Geburtstage, oder viel schlimmer, deinen Hochzeitstag - Birthdays Download

Antworten
Maximilian O
  • Forum-Beiträge: 990

11.01.2012, 16:46:44 via Website

Derzeit ist es so, wenn ich meine App offline benutze (ohne Internetverbindung) wird der Hintergrund nicht repeated.
Hab wirklich keine Ahnung was das sein kann.
Hatte dieses Problem noch niemand?

MfG

Vergiss nie wieder Geburtstage, oder viel schlimmer, deinen Hochzeitstag - Birthdays Download

Antworten
Daniel online
  • Forum-Beiträge: 282

11.01.2012, 20:26:01 via Website

Hallo Maximilian,

das hört sich ja komisch an. Hast du es denn schon auf anderen Geräten als auf deinem Smartphone getestet?
Wenn du willst, schick mir mal die App dann teste ich sie auf meinen Geräten.

LG,
Daniel

Antworten
Maximilian O
  • Forum-Beiträge: 990

18.01.2012, 16:20:49 via Website

Heyho,
ich habe meine App heute nocheinmal auf einem SGS2 getestet, da taucht leider der selbe Fehler auf. Hier einmal ein Screenshot:



Rechts passt alles, so soll es aussehen. Doch ab und zu, nach einigem Benutzen der App funktioniert der tiledMode leider nichtmehr. Dann wird die Grafik nur auf den ganzen Bildschirm gestreched.

Habt ihr eine Idee was man dagegen machen kann? Wer sich den Fehler mal in natura ansehen möchte, kann sich meine App ja einmal downloaden und testen.

Liebe Grüße Maximilian

Vergiss nie wieder Geburtstage, oder viel schlimmer, deinen Hochzeitstag - Birthdays Download

Antworten
Maximilian O
  • Forum-Beiträge: 990

19.01.2012, 13:51:02 via Website

Heyho,
ich habe herausgefunden, dass sobald ich die App über Einstellungen->Anwendungen->Prozesse verwalten kille (Taskmanager reicht da nicht aus), funktioniert sie wieder. Aber auch nur einige Male, dann kommt das Problem wieder.
Hatte das schon einmal jemand?

MfG Maximilian

Vergiss nie wieder Geburtstage, oder viel schlimmer, deinen Hochzeitstag - Birthdays Download

Antworten
Mac Systems
  • Forum-Beiträge: 1.727

19.01.2012, 14:49:41 via Website

Nein. Es kann gut sein das das ein Hersteller Problem ist. Meine Erfahrung sagt das Android auf Gerät xyz nicht unbedingt exakt immer das selbe verhalten zeigen muss wie auf ABC. Weiterhin ist der Fehler 'nur' unschön, aber kein Showstopper.

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

Antworten
Maximilian O
  • Forum-Beiträge: 990

19.01.2012, 14:57:59 via Website

Mac Systems
Nein. Es kann gut sein das das ein Hersteller Problem ist. Meine Erfahrung sagt das Android auf Gerät xyz nicht unbedingt exakt immer das selbe verhalten zeigen muss wie auf ABC. Weiterhin ist der Fehler 'nur' unschön, aber kein Showstopper.
Heyho,
ich dachte auch zuerst es sei ein HTC spezifisches Problem. Doch außer auf dem Sensation taucht das Verhalten auf eine Galaxy2 auch auf.
Ich kann dieses Verhalten leider nicht nachvollziehen, da ich Apps habe in dene ich haargenau denselben Code verwende und er funktioniert. Immer.

Vergiss nie wieder Geburtstage, oder viel schlimmer, deinen Hochzeitstag - Birthdays Download

Antworten
venni
  • Forum-Beiträge: 89

29.01.2012, 13:14:10 via Website

Hallo,

ich habe gerade exakt das Selbe Problem.
Dabei kann ich auch nicht ausmachen woran es liegt. Es nicht nicht nachstellbar.
Mal gehts, mal nicht.

Welche Alternativen gibt es denn zum "Tile" per xml?
Fand es bisher als elegante Alternative um mit einer kleinen Bilddatei alle Auflösungen bedienen zu können.
Aber so tuts ja nicht ordentlich.

Dachte an ein großes Backgroundbild, welches aber nicht an die Auflösung angepasst (also nicht skaliert) wird, sondern nur den Teil des Bildes darstellt der vom Bildschirm abgedeckt wird.
Geht sowas?
Habe es bisher nur skalierend hinbekommen...aber dann sieht Carbon ganz schön "bescheiden" aus wenn es zu stark geshrinkt wird.

Gruß
Frank

Antworten
Maximilian O
  • Forum-Beiträge: 990

29.01.2012, 13:26:15 via Website

Hey Frank,
um nur den benötigten Ausschnitt anzuzeigen benutze ich folgenden Code:

1<ImageView
2 android:layout_width="fill_parent"
3 android:layout_height="fill_parent"
4 android:scaleType="matrix"
5 android:adjustViewBounds="true"
6 android:layout_alignParentBottom="true"
7 android:id="@+id/background_imageview"
8 android:layout_marginLeft="-1dip"
9 />

Das Hintergrundbild setze ich dann per Java:

1backgroundImageView.setImageDrawable(getResources().getDrawable(R.drawable.background_wood));

Das funktioniert zwar richtig gut, kommt aber der Dateigröße nicht gerade entgegen. Deswegen gibt es ja extra den tileMode, traurig das Google das nicht gebacken bekommt.

MfG Maximilian

— geändert am 29.01.2012, 14:50:23

Vergiss nie wieder Geburtstage, oder viel schlimmer, deinen Hochzeitstag - Birthdays Download

Antworten
venni
  • Forum-Beiträge: 89

29.01.2012, 14:49:35 via Website

Hi Maximilian,

probiere ich später einmal aus.
Vielen Dank :-)

Gruß
Frank

Antworten
venni
  • Forum-Beiträge: 89

25.02.2012, 08:18:40 via Website

Hmm, gibts ja nen case zu: http://code.google.com/p/android/issues/detail?id=15340

Wenn ich den die Posts richtig verstehe, darf man auf Multiprozessoren die selbe Datei nicht mehrfach verwenden.
Der letzte Postbeitrag beschreibt pro activity eine eigene Datei, sodass diese dann nur von der jeweiligen activity verwendet wird und sich die nicht mit anderen teilen muss.
Glaube das teste ich gleich mal...oder hat das schon jemand gemacht?
Das mit der großen Bilddatei ist echt der letzte Rettungsanker wenn der Rest nicht geht :smug:

Antworten
venni
  • Forum-Beiträge: 89

25.02.2012, 08:35:52 via Website

Wäre ja auch zu schön gewesen...weder android:dither="true" in der backrepeat.xml selbst, noch die separaten Dateien fürs backrepeat je Activity haben geholfen :-(

Antworten
Maximilian O
  • Forum-Beiträge: 990

25.02.2012, 09:56:21 via Website

venni
Wäre ja auch zu schön gewesen...weder android:dither="true" in der backrepeat.xml selbst, noch die separaten Dateien fürs backrepeat je Activity haben geholfen :-(
Hay venni,
das Dithering habe ich auch schon einmal ausgetestet, aber auch ohne Erfolg. Die 2. Erklärung in dem Thread hat mir eigentlich eingeleuchtet, hätte gedacht dass die funktioniert. Tritt bei dir das Problem nur bei MultiCore Telefonen auf, oder auch bei SingleCores?

Liebe Grüße Maximilian

Vergiss nie wieder Geburtstage, oder viel schlimmer, deinen Hochzeitstag - Birthdays Download

Antworten
venni
  • Forum-Beiträge: 89

25.02.2012, 10:50:01 via App

Wenn ich das mal wüsste. Hab selbst nur ein SGS2.
Ich glaube aber auch festgestellt zu haben dass das nur bei ScrollViews auftritt.
Und letztlich muss ich ja auch eine Lösung für Multicores haben.
Das nervt :-(

Antworten
Maximilian O
  • Forum-Beiträge: 990

25.02.2012, 10:58:38 via Website

venni

Ich glaube aber auch festgestellt zu haben dass das nur bei ScrollViews auftritt.
In meiner App verwende ich keine ScrollView und trotzdem tritt das Problem auf.
Mir ist etwas sehr mysteriöses in einer meiner Apps aufgefallen, sobald ich die Internet-Verbindung kappe (egal ob WLAN oder Mobiles), setzt der tileMode sofort aus. Erst wenn ich es wieder anschalte funktioniert wieder alles. Dieses Verhalten hat aber nur diese eine App, bei allen anderen funktioniert es.
mir war so als ob das Problem mit dem Hintergrund erst seit Herbst letzten Jahres auftritt. Ab und zu konnte ich dieses Verhalten schon vorher beobachten, aber so krass wie jetzt ist es erst seit den Apps die ich im Herbst angefangen habe.

Aber leider gibt es ja zum tileMode keine wirkliche Alternative, das ist wirklich Mist. Eine große BG-Resource treibt zum einen die Dateigröße in die Höhe und die App sieht bei Tablets jenseits der 1000 px Marke meist nicht so toll.

Liebe Grüße Maximilian

Vergiss nie wieder Geburtstage, oder viel schlimmer, deinen Hochzeitstag - Birthdays Download

Antworten
venni
  • Forum-Beiträge: 89

25.02.2012, 11:11:44 via Website

Hört sich alles sehr strange an.
Im Moment weiß ich damit noch nicht umzugehen.
Das ganze führt ja dazu das jemand die App gar nicht mehr nutzt weil es einfach nur noch "bescheiden" aussieht.
Und das nicht immer, sondern nur dann und wann mal.
Bis gerade hatte ich noch darüber nachgedacht es so zu machen wie Du sagtest.
Eine große Bilddatei die alle Auflösungen abdeckt (ja die APK wird dann halt leider nun mal groß) und dann nur den Bildbereich anzeigen lassen als Hintergrund wie Du es oben beschrieben hattest. Jetzt sagst Du ja dass es auch nicht so toll aussieht....AAAAHHHHHHH
So langsam ist es Zeit schreiend im Kreis zu laufen... :wacko:

Ich habe übrigens gerade nach gezielter Nachfrage bei einem Bekannten die Rückmeldung bekommen das er keine Probleme mit dem Hintergrund feststellen konnte. Er hat einen Single-Core.

Gruß
Frank

Antworten
venni
  • Forum-Beiträge: 89

26.02.2012, 09:03:53 via Website

Maximilian O
Hey Frank,
um nur den benötigten Ausschnitt anzuzeigen benutze ich folgenden Code:

1<ImageView
2 android:layout_width="fill_parent"
3 android:layout_height="fill_parent"
4 android:scaleType="matrix"
5 android:adjustViewBounds="true"
6 android:layout_alignParentBottom="true"
7 android:id="@+id/background_imageview"
8 android:layout_marginLeft="-1dip"
9 />

Das Hintergrundbild setze ich dann per Java:

1backgroundImageView.setImageDrawable(getResources().getDrawable(R.drawable.background_wood));

Hi Maximilian,

fluppt bei mir nicht wirklich.
XML (Innerhalb des TableLayouts):
1<ImageView android:layout_width="fill_parent"
2 android:layout_height="fill_parent"
3 android:scaleType="matrix"
4 android:adjustViewBounds="true"
5 android:layout_alignParentBottom="true"
6 android:id="@+id/background_1280_1280"
7 android:layout_marginLeft="-1dip"/>

Und im onCreate der Activity:
1ImageView backgroundImageView = new ImageView (this);
2backgroundImageView.setImageDrawable(getResources().getDrawable(R.drawable.background_1280_1280));

Machst Du noch was anderes?
Sollte doch eigentlich klappen, oder?

Gruß
Frank

Antworten
Maximilian O
  • Forum-Beiträge: 990

26.02.2012, 09:43:54 via Website

Hey Frank,
du legst dir ja eine neue ImageView in der onCreate an (mittels new), diese addest du aber nie dem Layout.

Das einfachste ist doch, wenn du dir die ImageView folgendermaßen holst:
1ImageView backgroundImageView =(ImageView) findViewById(R.id.background_1280_1280);

Liebe Grüße Maximilian

Vergiss nie wieder Geburtstage, oder viel schlimmer, deinen Hochzeitstag - Birthdays Download

Antworten
venni
  • Forum-Beiträge: 89

26.02.2012, 10:01:00 via Website

Hallooo, Wald??? Ich seh die Bäume nicht.
Klar, sollte schon referenzieren. :*)

Kriegs nur nicht in meinem kompletten TableLayout als Hintergrund gesetzt.
Was funktioniert ist das ImageView vor meinem TableLayout darzustellen, sodass anschliessend dann mein TableLayout ohne die im Hintergrund liegende ImageView dargestellt wird. Das hilft ja nicht weiter dann.
Ich kann wohl kein ImageView in einem TableLayout überlagern.
Glaube irgendwie nicht dass ich damit weiterkomme :-(

Gleich setze ich den Hintergrund aus schwarz und fertig :angry:

Antworten
Maximilian O
  • Forum-Beiträge: 990

26.02.2012, 12:01:07 via Website

venni
Kriegs nur nicht in meinem kompletten TableLayout als Hintergrund gesetzt.
Was funktioniert ist das ImageView vor meinem TableLayout darzustellen, sodass anschliessend dann mein TableLayout ohne die im Hintergrund liegende ImageView dargestellt wird. Das hilft ja nicht weiter dann.
Ich kann wohl kein ImageView in einem TableLayout überlagern.
Hey Frank,
ich kenne mich nicht mit TableLayouts aus, da ich sie noch nie benutzt habe. Ich konnte bisher alles mittels RelativeLayout und LinearLayouts lösen. Ist das TableLayout denn zwingend notwendig? Du könntest doch um das TableLayout ein RelativeLayout legen:

<RelativeLayout>
<ImageView />
<TableLayout></TableLayout>
</RelativeLayout

So behälst du dein TableLayout bei und hast trotzdem im Hintergrund die ImageView.

venni

Gleich setze ich den Hintergrund aus schwarz und fertig :angry:
Alles, nur das nicht! :huh:
Das wäre (meiner Meinung nach) die schlimmste Variante, da sie dich User kosten wird. Ich benutze zu 99% keine Apps mit schwarzem Hintergrund, da mir dann der Spaß an der App vergeht (das reißt auch die Funktionalität nichtmehr raus). Das Design ist das wichtigste Kriterium für deine App, da der User danach deine App im Market beurteilt.

Wir schaffen das mit dem Repeat noch irgendwie, keine Angst. Hat denn niemand anders eine Idee?

Liebe Grüße Maximilian

— geändert am 26.02.2012, 12:03:08

Vergiss nie wieder Geburtstage, oder viel schlimmer, deinen Hochzeitstag - Birthdays Download

Antworten
venni
  • Forum-Beiträge: 89

26.02.2012, 13:56:35 via Website

Maximilian O

Alles, nur das nicht! :huh:
Da hast Du Recht.

Wenn ich ein RelativeLayout drüberlege, wird das Bild trotzdem skaliert und aufgrund des Seitenverhältnisses des Bildes nicht vollständig hinterlegt.

Also der Einfachheit halber mal die komplette View:
1<?xml version="1.0" encoding="utf-8"?>
2<ScrollView
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 android:layout_width="fill_parent"
5 android:layout_height="fill_parent"
6 >
7
8<TableLayout
9 xmlns:android="http://schemas.android.com/apk/res/android"
10 android:layout_width="fill_parent"
11 android:layout_height="fill_parent"
12
13 android:focusable="true"
14 android:focusableInTouchMode="true"
15 android:shrinkColumns="0"
16 android:stretchColumns="1" >
17
18 <TextView android:layout_width="wrap_content" android:text="@string/tx_fahrt_erfassen" android:id="@+id/textView1" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_marginLeft="4dip"></TextView>
19 <TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
20 <TextView android:text="@string/tx_startdatum" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
21 <TextView android:text="31.10.2011" android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
22 </TableRow>
23 <TableRow android:id="@+id/tableRow2" android:layout_width="wrap_content" android:layout_height="wrap_content">
24 <TextView android:text="@string/tx_startuhrzeit" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
25 <TextView android:text="14:35" android:id="@+id/textView7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
26 </TableRow>
27 <TableRow android:id="@+id/tableRow3" android:layout_width="wrap_content" android:layout_height="wrap_content">
28 <Button android:text="Start ändern" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="35dp"></Button>
29 </TableRow>
30 <TableRow android:id="@+id/tableRow4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
31 <TextView android:text="@string/tx_ankunftsdatum" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
32 <TextView android:text="31.10.2011" android:id="@+id/textView6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
33 </TableRow>
34 <TableRow android:id="@+id/tableRow5" android:layout_width="wrap_content" android:layout_height="wrap_content">
35 <TextView android:text="@string/tx_ankunftsuhrzeit" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView8" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
36 <TextView android:text="18:45" android:id="@+id/textView9" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
37 </TableRow>
38 <TableRow android:id="@+id/tableRow6" android:layout_width="wrap_content" android:layout_height="wrap_content">
39 <Button android:text="Ankunft ändern" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="35dp"></Button>
40 </TableRow>
41 <TableRow android:id="@+id/tableRow7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
42 <TextView android:text="Start-Km:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView10" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
43 <TextView android:text="1" android:id="@+id/textView11" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
44 </TableRow>
45 <TableRow android:id="@+id/tableRow8" android:layout_width="wrap_content" android:layout_height="wrap_content">
46 <TextView android:text="Ziel-Km:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView12" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
47 <TextView android:text="1" android:id="@+id/textView13" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
48 </TableRow>
49 <TableRow android:id="@+id/tableRow9" android:layout_width="wrap_content" android:layout_height="wrap_content">
50 <TextView android:text="Distanz:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView14" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
51 <TextView android:text="1" android:id="@+id/textView15" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
52 </TableRow>
53 <TableRow android:id="@+id/tableRow10" android:layout_width="wrap_content" android:layout_height="wrap_content">
54 <Button android:text="Strecke ändern" android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="35dp"></Button>
55 </TableRow>
56 <TableRow android:id="@+id/tableRow11" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
57 <TextView android:text="Startort:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView16" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
58 </TableRow>
59 <TableRow android:id="@+id/tableRow12" android:layout_width="wrap_content" android:layout_height="wrap_content">
60 <AutoCompleteTextView android:inputType="textCapSentences|textImeMultiLine" android:layout_marginLeft="4dip" android:layout_marginRight="4dip" android:layout_span="3" android:id="@+id/autoCompleteTextView1" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
61 </TableRow>
62 <TableRow android:id="@+id/tableRow13" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
63 <TextView android:text="Zielort:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView17" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
64 </TableRow>
65 <TableRow android:id="@+id/tableRow14" android:layout_width="wrap_content" android:layout_height="wrap_content">
66 <AutoCompleteTextView android:inputType="textCapSentences|textImeMultiLine" android:layout_marginLeft="4dip" android:layout_marginRight="4dip" android:layout_span="3" android:id="@+id/autoCompleteTextView2" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
67 </TableRow>
68 <TableRow android:id="@+id/tableRow15" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
69 <TextView android:text="Bemerkungen:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView18" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
70 </TableRow>
71 <TableRow android:id="@+id/tableRow16" android:layout_width="wrap_content" android:layout_height="wrap_content">
72 <AutoCompleteTextView android:inputType="textCapSentences|textImeMultiLine" android:layout_marginLeft="4dip" android:layout_marginRight="4dip" android:layout_span="3" android:id="@+id/autoCompleteTextView3" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
73 </TableRow>
74 <TableRow android:id="@+id/tableRow17" android:layout_width="wrap_content" android:layout_height="wrap_content">
75 <Button android:layout_marginLeft="4dip" android:text="Anlegen" android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="35dp" android:layout_marginTop="10dip"></Button>
76 </TableRow>
77 <TableRow android:id="@+id/tableRow18" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
78
79 </TableRow>
80
81</TableLayout>
82
83</ScrollView>

Antworten
Maximilian O
  • Forum-Beiträge: 990

26.02.2012, 14:06:58 via Website

Also bei mir funktioniert es so:

1<?xml version="1.0" encoding="utf-8"?>
2<RelativeLayout
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 android:layout_width="fill_parent"
5 android:layout_height="fill_parent">
6 <ImageView
7 android:layout_width="fill_parent"
8 android:layout_height="fill_parent"
9 android:scaleType="matrix"
10 android:adjustViewBounds="true"
11 android:layout_alignParentBottom="true"
12 android:src="@drawable/western_background"
13 android:id="@+id/background_imageview"
14 android:layout_marginLeft="-1dip"
15 />
16<ScrollView
17 android:layout_width="fill_parent"
18 android:layout_height="fill_parent"
19 >
20
21<TableLayout
22 xmlns:android="http://schemas.android.com/apk/res/android"
23 android:layout_width="fill_parent"
24 android:layout_height="fill_parent"
25
26 android:focusable="true"
27 android:focusableInTouchMode="true"
28 android:shrinkColumns="0"
29 android:stretchColumns="1" >
30
31 <TextView android:layout_width="wrap_content" android:text="hallo" android:id="@+id/textView1" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_marginLeft="4dip"></TextView>
32 <TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
33<TextView android:text="hallo" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
34 <TextView android:text="31.10.2011" android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
35 </TableRow>
36 <TableRow android:id="@+id/tableRow2" android:layout_width="wrap_content" android:layout_height="wrap_content">
37 <TextView android:text="hallo" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
38 <TextView android:text="14:35" android:id="@+id/textView7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
39 </TableRow>
40 <TableRow android:id="@+id/tableRow3" android:layout_width="wrap_content" android:layout_height="wrap_content">
41 <Button android:text="Start ändern" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="35dp"></Button>
42 </TableRow>
43 <TableRow android:id="@+id/tableRow4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
44 <TextView android:text="hallo" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
45 <TextView android:text="31.10.2011" android:id="@+id/textView6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
4633 </TableRow>
4734 <TableRow android:id="@+id/tableRow5" android:layout_width="wrap_content" android:layout_height="wrap_content">
4835 <TextView android:text="hallo" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView8" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
4936 <TextView android:text="18:45" android:id="@+id/textView9" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
5037 </TableRow>
5138 <TableRow android:id="@+id/tableRow6" android:layout_width="wrap_content" android:layout_height="wrap_content">
5239 <Button android:text="Ankunft ändern" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="35dp"></Button>
5340 </TableRow>
5441 <TableRow android:id="@+id/tableRow7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
5542 <TextView android:text="Start-Km:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView10" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
5643 <TextView android:text="1" android:id="@+id/textView11" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
5744 </TableRow>
5845 <TableRow android:id="@+id/tableRow8" android:layout_width="wrap_content" android:layout_height="wrap_content">
5946 <TextView android:text="Ziel-Km:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView12" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
6047 <TextView android:text="1" android:id="@+id/textView13" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
6148 </TableRow>
6249 <TableRow android:id="@+id/tableRow9" android:layout_width="wrap_content" android:layout_height="wrap_content">
6350 <TextView android:text="Distanz:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView14" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
6451 <TextView android:text="1" android:id="@+id/textView15" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
6552 </TableRow>
6653 <TableRow android:id="@+id/tableRow10" android:layout_width="wrap_content" android:layout_height="wrap_content">
6754 <Button android:text="Strecke ändern" android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="35dp"></Button>
6855 </TableRow>
6956 <TableRow android:id="@+id/tableRow11" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
7057 <TextView android:text="Startort:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView16" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
7158 </TableRow>
7259 <TableRow android:id="@+id/tableRow12" android:layout_width="wrap_content" android:layout_height="wrap_content">
7360 <AutoCompleteTextView android:inputType="textCapSentences|textImeMultiLine" android:layout_marginLeft="4dip" android:layout_marginRight="4dip" android:layout_span="3" android:id="@+id/autoCompleteTextView1" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
7461 </TableRow>
7562 <TableRow android:id="@+id/tableRow13" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
7663 <TextView android:text="Zielort:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView17" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
7764 </TableRow>
7865 <TableRow android:id="@+id/tableRow14" android:layout_width="wrap_content" android:layout_height="wrap_content">
7966 <AutoCompleteTextView android:inputType="textCapSentences|textImeMultiLine" android:layout_marginLeft="4dip" android:layout_marginRight="4dip" android:layout_span="3" android:id="@+id/autoCompleteTextView2" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
8067 </TableRow>
8168 <TableRow android:id="@+id/tableRow15" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
8269 <TextView android:text="Bemerkungen:" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/textView18" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dip"></TextView>
8370 </TableRow>
8471 <TableRow android:id="@+id/tableRow16" android:layout_width="wrap_content" android:layout_height="wrap_content">
8572 <AutoCompleteTextView android:inputType="textCapSentences|textImeMultiLine" android:layout_marginLeft="4dip" android:layout_marginRight="4dip" android:layout_span="3" android:id="@+id/autoCompleteTextView3" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
8673 </TableRow>
8774 <TableRow android:id="@+id/tableRow17" android:layout_width="wrap_content" android:layout_height="wrap_content">
8875 <Button android:layout_marginLeft="4dip" android:text="Anlegen" android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="35dp" android:layout_marginTop="10dip"></Button>
8976 </TableRow>
9077 <TableRow android:id="@+id/tableRow18" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip">
9178
9279 </TableRow>
9380
9481</TableLayout>
9582
9683</ScrollView>
97</RelativeLayout>

Setze den Hintergrund mal zum Test mit
1android:src="@drawable/western_background"

Nicht wundern, ich habe in deinem Code einige String Resourcen gelöscht, kannst du ja einfach wieder hinzufügen.

Liebe Grüße Maximilian

Vergiss nie wieder Geburtstage, oder viel schlimmer, deinen Hochzeitstag - Birthdays Download

Antworten
venni
  • Forum-Beiträge: 89

26.02.2012, 15:51:30 via Website

Maximilian, Du rettest mir den Tag!
Ganz ehrlich :)

Ich hatte das RelativeLayout nach dem ScrollView gemacht.
Da gings nicht.
Vor allem anderen, inkl. des ScrollViews wie Du es gemacht hattest, geht´s wunderbar.
Wenn man mit dem größeren Bild in der APK leben kann, sind bei mir ein paar kB gewesen, dann ist das echt der beste Workarround.

VIELEN DANK!!!! :grin:

Antworten