gpt4 book ai didi

java - 如何将动态文本逐行放置?

转载 作者:行者123 更新时间:2023-12-01 14:47:18 24 4
gpt4 key购买 nike

{
Recipedetails2 item_details = new Recipedetails2();
item_details.setName("Godhumai veg adai");
item_details.setIngredients("Samba godhumai rava - 1/2 cup. Bread slices - 4. Curd ( thick ) - 1/2 cup Carrot ( grated ) - 3 tsp Beetroot ( grated ) - 3 tsp Cabbage ( grated ) - 2 tsp Green chilli - 1 Ginger - a small piece Garlic - 2 cloves Salt - as neededOil - as needed ");
item_details.setMethods("1. Cut ginger, green chilli, garlic finely. 2. Soak samba godhumai rava in curd for half an hour. 3. Dip bread slices in water, squeeze and add to the godhumai. 4. Add carrot, beetroot ,cabbage, ginger, green chilli, garlic , salt, water and mix well to a batter. 5. Heat oil in a skillet. 6. Add ladle of batter, spread to a small thick circle and cook on both sides, dribbling oil.");
item_details.setImageNumber(12);
setUIScreen(item_details.getName(),item_details.getIngredients(),item_details.getMethods(),item_details.getImageNumber() );
}

它会像段落一样出现,但我需要的是它必须出现第一个点,然后下一行下一个点就像我需要的那样,我们如何在这段代码中做到这一点方法1.将黄 bean 粉与酪乳、盐混合成面糊。2. 在煎锅中加热油。3. 加入芥末、乌拉木 bean ,当芥末飞溅时,加入红辣椒、阿魏、大 bean 混合,用中火不断搅拌。4. 当内容物离开锅边时,转移到涂有油脂的盘子上,撒上更多米拉盖、 curry 叶并切成方 block 。我需要这样,但它是作为一个段落出现的我的layout.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"

>

<TextView android:id="@+id/name"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="#32cd32"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

<ImageView
android:id="@+id/photo"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_gravity="top"
android:padding="20dp"
android:scaleType="center"
></ImageView>



<TextView
android:text="Ingredients:"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left" />

<TextView android:id="@+id/itemIngredients"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center" />

<TextView
android:text="Method:"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left" />

<TextView android:id="@+id/methods"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center" />

</LinearLayout>

最佳答案

使用换行符\n强制换行:

1. Mix soya flour with buttermilk, salt to a batter.\n
2. Heat oil in a frying pan.\n
3. Add mustard, urad dal and when mustard splutters, add red chilli, asafoetida, soya mix and stir constantly on a medium flame.\n
4. When contents leave the sides of the pan, transfer to a greased plate, sprinkle moremilagai, curry leaves and cut into squares.

因此,无论您想在何处开始换行,都可以放置 \n

关于java - 如何将动态文本逐行放置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15294418/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com