Προς το περιεχόμενο

Android imageView fill TableRow


Προτεινόμενες αναρτήσεις

Δημοσ.

Καλησπέρα, για ακόμη μία φορά θα χρειαστώ την βοήθεια σας.'Εχω τον παρακάτω κώδικα και παρόλο που έχω βάλω το android:scaleType="fitXY" μου γεμίζει μόνο κάθετα και όχι οριζόντια ... Δηλαδη η εικόνα έιναι τραβηγμένη μόνο ως προς Υ . Που έχω κάνει λάθος; ΕΥΧΑΡΙΣΤΩ !!

 

 

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent" android:stretchColumns="*" >
    <TableRow android:id="@+id/tableRow0"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_weight="1">
        <ImageView
            android:layout_width="100dp"
            android:layout_height="match_parent"
            android:id="@+id/imageView2"
            android:layout_gravity="center"
            android:layout_span="2"
            android:scaleType="fitXY"></ImageView>
    </TableRow>
    <TableRow android:id="@+id/tableRow1"
        android:layout_height="wrap_content"
        android:layout_width="match_parent">
        <ZoomControls
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/zoomControlsActivity2"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" />
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Πίσω"
            android:id="@+id/buttonPisw"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true" />
 
    </TableRow>
 
</TableLayout>
 
Δημοσ.

Φαινεται οτι δεν εισαι ο μονος/η που αντιμετωπιζει το συγκεκριμενο προβλημα.

 

Θα εριχνα μια ματια σε αυτες τις δυο ερωτησεις. Ελπιζω να σε βοηθησουν.

http://stackoverflow.com/questions/17901243/android-imageview-setting-bitmap-fitxy-doesnt-work

http://stackoverflow.com/questions/6557516/making-grid-view-items-square

Δημοσ.

βλέπω έχεις βάλει το             android:layout_width="100dp" σίγουρα δεν γίνεται το scale και απλά δεν το βλέπεις;

Δημοσ.

βλέπω έχεις βάλει το             android:layout_width="100dp" σίγουρα δεν γίνεται το scale και απλά δεν το βλέπεις;

Το έσβησα το android:layout_width="100dp" (τίποτα το ίδιο)..... την εικόνα την βλέπω, είναι μόνο τραβηγμένη ως προς Υ.Ακόμη το ψάχνω ...... :)

 

Τελικά τα κατάφερα αλλά δεν κράτησα την TableLayout έβαλα μια RelativeLayout και το έφτιαξα!!(με το android:scaleType="fitXY")

Μάλλον φταίει κάτι στην TableLayout.... (δεν ξέρω τι να υποθέσω).ΕΥΧΑΡΙΣΤΩ ΚΑΙ ΠΆΛΙ ΟΣΟΥΣ ΑΣΧΟΛΗΘΗΚΑΝ !!

Δημοσ.

αφού είχα ανοιχτό το eclipse στην δουλειά, είδα να δω και από τον IDE τι παίζει.

 

με αυτό είσαι οκ, (χρώμα και εικόνα έβαλα για να δω τι φαίνεται)

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:stretchColumns="*" >

    <TableRow
        android:id="@+id/tableRow0"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1" >

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#FFFFFF"
            android:gravity="fill_horizontal"
            android:scaleType="fitXY"
            android:src="@drawable/ic_launcher" >
        </ImageView>
    </TableRow>

    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <ZoomControls
            android:id="@+id/zoomControlsActivity2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" />

        <Button
            android:id="@+id/buttonPisw"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:text="Πίσω" />
    </TableRow>

</TableLayout>
Δημοσ.

 

αφού είχα ανοιχτό το eclipse στην δουλειά, είδα να δω και από τον IDE τι παίζει.

 

με αυτό είσαι οκ, (χρώμα και εικόνα έβαλα για να δω τι φαίνεται)

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:stretchColumns="*" >

    <TableRow
        android:id="@+id/tableRow0"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1" >

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#FFFFFF"
            android:gravity="fill_horizontal"
            android:scaleType="fitXY"
            android:src="@drawable/ic_launcher" >
        </ImageView>
    </TableRow>

    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <ZoomControls
            android:id="@+id/zoomControlsActivity2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" />

        <Button
            android:id="@+id/buttonPisw"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:text="Πίσω" />
    </TableRow>

</TableLayout>

Φίλε μου σε ευχαριστώ είσαι πρώτος!!!

Δημιουργήστε ένα λογαριασμό ή συνδεθείτε για να σχολιάσετε

Πρέπει να είστε μέλος για να αφήσετε σχόλιο

Δημιουργία λογαριασμού

Εγγραφείτε με νέο λογαριασμό στην κοινότητα μας. Είναι πανεύκολο!

Δημιουργία νέου λογαριασμού

Σύνδεση

Έχετε ήδη λογαριασμό; Συνδεθείτε εδώ.

Συνδεθείτε τώρα
  • Δημιουργία νέου...