SORU
23 Mart 2011, ÇARŞAMBA


FrameLayout marjı çalışmıyor

Düzen benim yapısı böyle

LinearLayout
    FrameLayout
       ImageView
       ImageView
    FrameLayout
    TextView
LinearLayout

FrameLayout içinde olan iki İmageView için marj set var. Ama FrameLayout boşluklarını atılır ve her zaman sol üst köşesinde Görüntü ayarlayın. FrameLayout gelen boşluğu işini düzgün LinearLayout için değiştirdim. Bununla nasıl başa ?

<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@ id/inner1"
    >
        <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
        >

            <ImageView
             android:layout_width="24px" 
             android:layout_height="24px" 
             android:id="@ id/favicon"
             android:layout_marginLeft="50px"
             android:layout_marginTop="50px"
             android:layout_marginBottom="40px"
             android:layout_marginRight="70px"      

            />      
            <ImageView
             android:layout_width="52px" 
             android:layout_height="52px" 
             android:id="@ id/applefavicon" 
             android:layout_marginLeft="100px"
             android:layout_marginTop="100px"
             android:layout_marginBottom="100px"
             android:layout_marginRight="100px"              
            />

        </FrameLayout>  
            <TextView
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:id="@ id/title"                 
            android:layout_marginLeft="10px"        
            android:layout_marginTop="20px"
            android:textColor="#FFFFFF"  
            android:textSize = "15px"
            android:singleLine = "true"
            />

    </LinearLayout>

CEVAP
25 Mayıs 2011, ÇARŞAMBA


Ben de aynı sorunu kendimi ve fark ettim ki ayarı layout_ kenar boşlukları çalışmıyor kadar da set İmageView düzeni yerçekimi yani android:layout_gravity="top" XML kaynak dosyası veya kod: FrameLayout.LayoutParams.gravity = Gravity.TOP;.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Matthew Smith

    Matthew Smit

    24 Mayıs 2010
  • Kanál používateľa McsFuego

    Kanál použ

    12 EKİM 2011
  • The Verge

    The Verge

    8 AĞUSTOS 2006