2010-06-16 32 views

Trả lời

2

i usedthe sau mã, nhưng nó vẫn có một số thiếu sót: bạn nên thay đổi các giá trị:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/widget" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 

android:layout_gravity="center_horizontal|center_vertical" 
> 
<EditText 
    android:id="@+id/bullet" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 

    android:paddingRight="4dip" 
    android:includeFontPadding="false" 
    android:lines="4" 
    android:text="hidhidihfidhfdifhdifhdifhidhfidf" /> 
<ImageView 
    android:id="@+id/icon" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="#ffff00" 
    android:src="@drawable/icon" 
    android:layout_alignTop="@id/bullet" 

    android:layout_marginLeft="50dip" /> 

    <ImageView 
    android:id="@+id/icon1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 

    android:background="#ff00ff" 
    android:layout_alignBottom="@id/bullet" 

    android:layout_marginLeft="100dip" 
    android:src="@drawable/star_logo" /> 

    </RelativeLayout> 
1

@pengwang và để những ai quan tâm

ban đầu đề cập đến dòng tại cơ sở của bất kỳ chế độ xem, nút, số lần xem hình ảnh hoặc bất kỳ điều khiển nào. khi bạn đang sử dụng tài sản cơ sở thì bạn đang đưa ra bất kỳ id nào trong đó cơ sở bạn muốn tham chiếu hoặc đó là nơi bạn muốn nút của bạn hoặc bất kỳ. khi bạn chuyển sang chế độ đồ họa nó sẽ hiển thị như thế nào nó adresses cơ bản mà bạn đã xác định

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 
    <RelativeLayout 
     android:id="@+id/relativeLayout1" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" > 
     <ImageButton 
      android:id="@+id/iB" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/ic_launcher" 
      android:layout_alignParentBottom="true" /> 

     <Button 
      android:id="@+id/button1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Button" 
      android:layout_alignParentBottom="true" 
      android:layout_toRightOf="@id/iB" 
      android:layout_alignBaseline="@id/relativeLayout1" /> 
    </RelativeLayout> 
</LinearLayout> 
0

làm điều gì đó như thế này

<EditText 
     android:id="@+id/searchedittext" 
     android:layout_width="fill_parent" 
     android:layout_height="50dip" 
     android:hint="Search Events, Restaurants, Businesses" 
     android:singleLine="true" 
     android:textSize="15dip" /> 

    <Button 
     android:id="@+id/searchbtn" 
     android:layout_width="40dip" 
     android:layout_height="40dip" 
     android:layout_marginLeft="-50dip" 
     android:background="@drawable/ic_menu_search" /> 
    <Button 
     android:id="@+id/searchbtn2" 
     android:layout_width="40dip" 
     android:layout_height="40dip" 
     android:layout_marginLeft="-30dip" 
     android:background="@drawable/ic_menu_search" /> 
</LinearLayout> 
-1

Đối với việc đặt trung tâm xem lại xem cha mẹ của bạn bạn chỉ cần chỉ định thuộc tính này android: gravity = "center"

Các vấn đề liên quan