0

我怎样才能应用这种设计特别是棕色边框,我怎样才能在屏幕末尾应用带有 2 个片段和静态按钮列表的东西。

抱歉,我无法上传图片网站错误:“您需要至少 10 个声望才能发布图片。”

所以你可以在这个链接上找到图片

图片

这是我的尝试

片段列表.xml

 <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  

        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="left"
        android:orientation="vertical"    
         >
         <TextView
                android:id="@+id/chapter_list_entry"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:textSize="28dip"
            />

           <TextView
               android:id="@+id/chapterid_list_entry"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:textSize="28dip"
               android:visibility="invisible"  />

    </LinearLayout>

hadith_details_activity_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" 
    android:id="@+id/country_details_fragment_container"    
    >
</LinearLayout>

hadith_details_fragment_layout.xml

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

    <TextView 
        android:id="@+id/country_details"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="25dp"
        android:layout_gravity="center"
        android:textColor="@color/blue"
        />

</LinearLayout>

主要的.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <fragment 
        android:id="@+id/hadith_list_fragment"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:name="rewaya.books.alhadith.HadithExpandableListFragment"

        />

</LinearLayout>

提前致谢

4

2 回答 2

0

例如,您可以使用这样的东西:

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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/buttonContainer"
        android:orientation="horizontal" >

        <fragment
            android:name="com.example.DetailsFragment"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

        <fragment
            android:name="com.example.ListFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/buttonContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal" >

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </LinearLayout>

</RelativeLayout>
于 2013-06-15T17:43:57.217 回答
0

您可以使用以下方法执行此操作:

  • 首先画一个大的LinearLayout或者RelativeLayout那将是其他组件的容器
  • 添加一个LinearLayout将包含另外两个FrameLayouts将与您的片段一起膨胀的片段 - 如果您使用LinearLayout您可以使用权重功能按比例分割片段宽度
  • 在 LinearLayout 下方,您可以添加一个新的容器布局(RelativeLinear Layout),您可以在其中添加这些按钮

要为您的片段设置边框,您可以将具有这些边框的背景图像/可绘制对象设置为您的FrameLayouts..

我希望它有所帮助。

于 2013-06-15T17:46:48.433 回答