Grafikfehler bei Dialogen

S

SirMArtin

Gast
Ich hab in meiner App ein paar kleine Grafikfehler. Ich verstehe nur nicht genau warum. Vielleicht hat einer von Euch eine Idee.
bitte_warten.png
Code:
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case PROGRESS_DIALOG:
      progressDialog = new ProgressDialog(this);
      progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      progressDialog.setMessage("Bitte warten...");
      progressDialog.setIcon(R.drawable.details);

      new ProgressThread(handler).start();

      return progressDialog;
    default:
      return null;
    }
  }
Beim zweiten Dialog habe ich einen AlertDialog customized wie im DevGuide beschrieben um ihn meinen Bedürfnissen anzupassen.

details.png
Code:
LayoutInflater inflater = activity.getLayoutInflater();
      View layout = inflater.inflate(R.layout.event_details, (ViewGroup) activity.findViewById(R.id.ed_layout));
      Builder builder = new AlertDialog.Builder(activity);
      builder.setView(layout);

      setText(R.id.recipient, R.id.tr_recipient, event.getRecipient(), layout);
      (... setze alle daten ...)

      AlertDialog dialog = builder.create();

      dialog.setTitle("Details");
      dialog.setCanceledOnTouchOutside(true);
      if (event.getStatus() != null)
        dialog.setIcon(event.getStatus().getIcon());
      dialog.show();
HTML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/ed_layout" xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:scrollbars="vertical" android:layout_marginTop="0px">


    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:stretchColumns="1">

        <TableRow>
            <TextView android:id="@+id/lbl_recieve_time" style="@style/Label"
                android:layout_column="1" android:text="@string/lbl_recieve_time" />
            <TextView android:id="@+id/recieve_time" android:gravity="right"
                style="@style/messageText" />
        </TableRow>
        <TableRow android:id="@+id/tr_event_time">
            <TextView android:id="@+id/lbl_event_time" style="@style/Label"
                android:layout_column="1" android:text="@string/lbl_event_time" />
            <TextView android:id="@+id/event_time" android:gravity="right"
                style="@style/messageText" />
        </TableRow>

        <TableRow android:id="@+id/tr_status_code">
            <TextView android:id="@+id/lbl_status_code" style="@style/Label"
                android:layout_column="1" android:text="@string/lbl_status_code" />
            <TextView android:id="@+id/status_code" android:gravity="right"
                style="@style/messageText" />
        </TableRow>

        <TableRow android:id="@+id/tr_recipient">
            <TextView android:id="@+id/lbl_recipient" style="@style/Label"
                android:layout_column="1" android:text="@string/lbl_recipient" />
            <TextView android:id="@+id/recipient" android:gravity="right"
                style="@style/messageText" />
        </TableRow>
    </TableLayout>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:scrollbars="vertical"
        android:isScrollContainer="true">
        <TextView android:id="@+id/lbl_status_text" style="@style/Label"
            android:text="@string/lbl_status_text" android:layout_width="fill_parent"
            android:layout_height="wrap_content" />

        <TextView android:id="@+id/status_text" style="@style/messageText"
            android:layout_width="fill_parent" android:layout_height="wrap_content" />

        <TextView android:id="@+id/lbl_addinfo" style="@style/Label"
            android:text="@string/lbl_addinfo" android:layout_width="fill_parent"
            android:layout_height="wrap_content" />

        <TextView android:id="@+id/addinfo" style="@style/messageText"
            android:layout_height="wrap_content" android:inputType="textMultiLine"
            android:layout_width="fill_parent" />
    </LinearLayout>
</LinearLayout>
Irgendwelche Ideen?

SirMArtin
 
ich habe ähnliche grafikfehler...ich wollte ein video in einem dialogfenster zeigen. sieht aber nschön aus. könnte aber bild dahinter liegen, denn wenn ich den screen um 90 grad drehe, also horizontal habe, siehst normal aus, ohne fehler.
 

Anhänge

  • videoview2_160.jpg
    videoview2_160.jpg
    32,5 KB · Aufrufe: 442
Bist Du schon weiter? Ich find hier einfach nicht den Fehler. :(
 
nein, leider nicht. ich vermute aber, dass es an dem ImageView im "hintergrund" liegt. wenn ich das bild um 90grad drehe wird das dialogfenster perfekt angezeigt. es liegt aber dann auch nicht mehr über dem imageview.
 
Ich bin einen Schritt weiter. Es hat mit dem Title im Dialog zu tun. Mein ProgressDialog hat jetzt auch einen Title bekommen. Hier ist dann auch der 2 oder 3 Pixel breite Abstand zwischen Title und Content.

Code:
progressDialog = new ProgressDialog(this);
      progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      progressDialog.setMessage("Bitte warten...  ");

      LayoutInflater inflater = this.getLayoutInflater();
      View layout = inflater.inflate(R.layout.wait_dialog_title, (ViewGroup) this.findViewById(R.id.wd_layout));
      progressDialog.setCustomTitle(layout);

Jetzt muss ich nur noch herausfinden, warum da der Abstand ist.
 
ok, das macht sinn. vielleicht ist das auch der grund für meine grafikfehler. die treten ja auch im bereich des titels auf.

Was hast du denn für ein Layoutart für den Titel hergenommen?
 
Ein Table-Layout. Ich werd's nachher mal mit nem LinearLayout testen.
 
LinearLayout tut auch nicht. :(
 
OK, hab's gefunden. Es war ein margin, das sich in der style.xml versteckte.
 

Ähnliche Themen

D
Antworten
17
Aufrufe
407
datNeMo
D
M
Antworten
3
Aufrufe
162
moin
M
Y
Antworten
4
Aufrufe
1.223
swa00
swa00
Zurück
Oben Unten