Philipp K
- Forum-Beiträge: 27
15.02.2011, 17:54:22 via Website
15.02.2011 17:54:22 via Website
Hallo!
Ich habe meine MainView auf der ich 2 Bilder anzeige.
Um die Grafiken richtig anzuzeigen müssen die Bilder herunterskaliert werden.
Kann man das mit den richtigen Layout automatisch machen?
Idee:
Die eine Hälfte vom Layout beinhaltet das eine Bild die andere das andere (Skalierung soll automatisch geschähen)
Screenshot:
Der Button unterhalb verschwindet da das Bild zu groß ist.
Layout:
Ich habe meine MainView auf der ich 2 Bilder anzeige.
Um die Grafiken richtig anzuzeigen müssen die Bilder herunterskaliert werden.
Kann man das mit den richtigen Layout automatisch machen?
Idee:
Die eine Hälfte vom Layout beinhaltet das eine Bild die andere das andere (Skalierung soll automatisch geschähen)
Screenshot:
Der Button unterhalb verschwindet da das Bild zu groß ist.
Layout:
1<?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="vertical">
5 <TextView android:layout_height="wrap_content" android:id="@+id/mainscreen" android:layout_width="fill_parent" android:text="Selected Channel" android:gravity="center"></TextView>
6 <ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView>
7 <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/mainscreen_state"></TextView>
8 <ImageView android:layout_width="wrap_content" android:layout_centerHorizontal="true" android:layout_height="wrap_content" android:id="@+id/ImageAd" android:layout_gravity="center"></ImageView> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
9 android:layout_height="fill_parent"
10 android:layout_width="fill_parent">
11
12
13 <Button android:layout_width="wrap_content"
14 android:layout_height="wrap_content"
15 android:layout_alignParentBottom="true"
16 android:layout_centerHorizontal="true"
17 android:id="@+id/mainscreen_btchange"
18 android:text="Change State"></Button>
19
20
21 </RelativeLayout>
22 </LinearLayout>
2 <LinearLayout
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="vertical">
5 <TextView android:layout_height="wrap_content" android:id="@+id/mainscreen" android:layout_width="fill_parent" android:text="Selected Channel" android:gravity="center"></TextView>
6 <ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView>
7 <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/mainscreen_state"></TextView>
8 <ImageView android:layout_width="wrap_content" android:layout_centerHorizontal="true" android:layout_height="wrap_content" android:id="@+id/ImageAd" android:layout_gravity="center"></ImageView> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
9 android:layout_height="fill_parent"
10 android:layout_width="fill_parent">
11
12
13 <Button android:layout_width="wrap_content"
14 android:layout_height="wrap_content"
15 android:layout_alignParentBottom="true"
16 android:layout_centerHorizontal="true"
17 android:id="@+id/mainscreen_btchange"
18 android:text="Change State"></Button>
19
20
21 </RelativeLayout>
22 </LinearLayout>
Empfohlener redaktioneller Inhalt
Mit Deiner Zustimmung wird hier ein externer Inhalt geladen.
Mit Klick auf den oben stehenden Button erklärst Du Dich damit einverstanden, dass Dir externe Inhalte angezeigt werden dürfen. Dabei können personenbezogene Daten an Drittanbieter übermittelt werden. Mehr Infos dazu findest Du in unserer Datenschutzerklärung.