相关疑难解决方法(0)

如何将(垂直)分隔符添加到水平LinearLayout?

我正在尝试将分隔符添加到水平线性布局但是无处可去.分频器没有显示.我是Android的新手.

这是我的布局XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/llTopBar"
        android:orientation="horizontal"
        android:divider="#00ff00"
        android:dividerPadding="22dip"
        android:showDividers="middle"
       >

        <Button
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:text="asdf" />
            <Button
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:text="asdf"
             />

    </LinearLayout>

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

android divider android-layout android-linearlayout

85
推荐指数
6
解决办法
15万
查看次数

在Android选项卡布局段落中创建线分隔线

嘿所有,首先发布和Android编程中的菜鸟,但愿意学习!基本上我从这里采用了标签布局的Google样本

我发现这个方法非常容易在每个标签中创建带有文本的标签,但我试图使其在选择标签时,我希望下面列出的文本用分界线分隔.所以每一段之间都有一条线,但是我在这方面遇到了麻烦.这是我到目前为止:main.xml:

<?xml version="1.0" encoding="utf-8"?>
Run Code Online (Sandbox Code Playgroud)

        <TableRow>
            <TextView
            android:id="@+id/textview1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="this is the FIRST line of the 1st tab" />
            <TextView
            android:id="@+id/textview1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="this is the SECOND line of the 1st tab" />
            </TableRow>
            <View
    android:layout_height="2dip"
    android:background="#FF909090" />

    <TableRow>
        <TextView 
            android:id="@+id/textview2"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" 
            android:text="this is First line of the 2nd tab" />
            </TableRow>
            <View
    android:layout_height="2dip"
    android:background="#FF909090" />
            <View
    android:layout_height="2dip"
    android:background="#FF909090" /> 
         <TextView 
            android:id="@+id/textview3"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" 
            android:text="this is the First line of the 3rd tab" />
         <TextView 
            android:id="@+id/textview4" …
Run Code Online (Sandbox Code Playgroud)

layout tabs android line divide

5
推荐指数
1
解决办法
2万
查看次数