Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/221.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 为单个listview项创建样式(不需要的缩放)_Android_Listview_Layout_Row - Fatal编程技术网

Android 为单个listview项创建样式(不需要的缩放)

Android 为单个listview项创建样式(不需要的缩放),android,listview,layout,row,Android,Listview,Layout,Row,嘿,我想为我的listView创建特定的单项目行,但不知道如何处理它 i、 stack.imgur.com/9fUmX.png 我使用线性布局上的权重制作了类似的东西,但当附加信息太长时,它无法正常工作 i、 stack.imgur.com/uG43j.png <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android

嘿,我想为我的listView创建特定的单项目行,但不知道如何处理它

i、 stack.imgur.com/9fUmX.png

我使用线性布局上的权重制作了类似的东西,但当附加信息太长时,它无法正常工作

i、 stack.imgur.com/uG43j.png

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:orientation="vertical" >

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="100dp"
    android:background="#55000000" >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:orientation="horizontal"
        android:weightSum="10" >

        <!-- pomysle jeszcze nad wagami -->

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="2" >

            <RelativeLayout
                android:layout_width="60dp"
                android:layout_height="match_parent" >

                <RelativeLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerHorizontal="true"
                    android:layout_centerVertical="true" >

                    <TextView
                        android:id="@+id/JsonItemDataNumberOfTheDayFree"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentTop="true"
                        android:layout_centerHorizontal="true"
                        android:layout_marginTop="10dp"
                        android:text="21"
                        android:textColor="#FFF"
                        android:textSize="15sp" />

                    <TextView
                        android:id="@+id/JsonItemDataMonthFree"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/JsonItemDataNumberOfTheDayFree"
                        android:layout_centerHorizontal="true"
                        android:text="CZE"
                        android:textColor="#FFF"
                        android:textSize="13sp" />
                </RelativeLayout>
            </RelativeLayout>
        </LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="7"
            android:orientation="vertical" >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <!-- tu nie jestem pewny margin top? -->

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical" >

                    <TextView
                        android:id="@+id/JsonItemTitleEventFree"
                        android:layout_width="200dp"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="25dp"
                        android:singleLine="true"
                        android:text="Title"
                        android:textColor="@android:color/white"
                        android:textSize="18sp" />

                    <TextView
                        android:id="@+id/JsonItemAdditionalInfoFree"
                        android:layout_width="200dp"
                        android:layout_height="wrap_content"
                        android:singleLine="true"
                        android:text="Additional Info"
                        android:textColor="@android:color/white"
                        android:textSize="14sp" />
                </LinearLayout>
            </LinearLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

                <TextView
                    android:id="@+id/JsonItemDateFree"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_alignParentLeft="true"
                    android:layout_marginBottom="10dp"
                    android:text="Date"
                    android:textColor="@android:color/white"
                    android:textSize="10sp" />
            </RelativeLayout>
        </LinearLayout>

        <LinearLayout
            android:layout_width="20dp"
            android:layout_height="100dp"
            android:layout_weight="1" >

            <ImageView
                android:id="@+id/JsonItemLogoCategoryFree"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="@drawable/category_music"
                android:scaleType="fitStart" />
        </LinearLayout>
    </LinearLayout>
</RelativeLayout>
试试这个

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#55000000"
android:orientation="horizontal" >

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_weight="2" >

    <RelativeLayout
        android:layout_width="60dp"
        android:layout_height="match_parent" >

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true" >

            <TextView
                android:id="@+id/JsonItemDataNumberOfTheDayFree"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="10dp"
                android:text="21"
                android:textColor="#FFF"
                android:textSize="15sp" />

            <TextView
                android:id="@+id/JsonItemDataMonthFree"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/JsonItemDataNumberOfTheDayFree"
                android:layout_centerHorizontal="true"
                android:text="CZE"
                android:textColor="#FFF"
                android:textSize="13sp" />
        </RelativeLayout>
    </RelativeLayout>
</LinearLayout>

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_weight="7"
    android:orientation="vertical" >

   <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

            <TextView
                android:layout_gravity="top"
                android:id="@+id/JsonItemTitleEventFree"
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:layout_marginTop="25dp"
                android:singleLine="true"
                android:text="Title"
                android:textColor="@android:color/white"
                android:textSize="18sp" />

            <TextView
                android:id="@+id/JsonItemAdditionalInfoFree"
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:text="Additional Info"
                android:textColor="@android:color/white"
                android:textSize="14sp" />
    </LinearLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/JsonItemDateFree"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_marginBottom="10dp"
            android:text="Date"
            android:textColor="@android:color/white"
            android:textSize="10sp" />
    </RelativeLayout>
</RelativeLayout>

<LinearLayout
    android:layout_width="20dp"
    android:layout_height="100dp"
    android:layout_weight="1" >

    <ImageView
        android:id="@+id/JsonItemLogoCategoryFree"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/category_music"
        android:scaleType="fitStart" />
</LinearLayout>