小编Pri*_*nce的帖子

如何子字符串化

我想得到这个字符串的4个部分

String string = "10 trillion 896 billion 45 million 56873";
Run Code Online (Sandbox Code Playgroud)

我需要的4个部分是“ 10万亿”,“ 8960亿”,“ 4500万”和“ 56873”。

我要做的是删除所有空格,然后对其进行子字符串化,但是我对索引感到困惑。我看到了很多问题,但无法理解我的问题。

Sorry I don't have any code
Run Code Online (Sandbox Code Playgroud)

我不能跑步,因为我不知道那是对的。

java android substring

4
推荐指数
3
解决办法
156
查看次数

如何在 ScrollView 中将 LinearLayout 高度设置为匹配父级

下面是我的 .XML 代码。我能不能解决这个问题。

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/ticket_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:isScrollContainer="true">

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

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

android scrollview android-layout

3
推荐指数
1
解决办法
926
查看次数

如何使用Android Studio通过WiFi进行调试

我试图设置为通过wifi(而不是通过USB,因为该应用需要将硬件插入USB端口)在平板电脑上(运行6.0.1)调试Android应用。

通过Windows命令提示符完成了连接过程,使adb通过wifi通讯,这似乎还可以-设备在192.168.0.16:5555上可以识别。

我以为我可以从Android Studio用户界面加载和调试应用了。错误-“没有设备”。只要通过USB插入,它就会显示出来。

我想我一定在这里没有什么窍门-如何让Android Studio通过wifi加载和调试它?

debugging android adb android-studio

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

如何制作方形CardView(Android)

如何制作广场CardView.

当我设置它时layout_weight ,CardView它没有设置为方形CardView.

请给我一个解决方案:(没有设置固定的高度和宽度)

见下图: 在此输入图像描述

码:

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

                    <android.support.v7.widget.CardView
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_margin="4dp"
                        android:layout_weight="2"
                        app:cardBackgroundColor="@color/silver"
                        tools:ignore="NestedWeights">


                    </android.support.v7.widget.CardView>

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:orientation="vertical"
                        android:weightSum="1">

                        <android.support.v7.widget.CardView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_margin="4dp"
                            android:layout_weight="0.5"
                            app:cardBackgroundColor="@color/silver">


                        </android.support.v7.widget.CardView>

                        <android.support.v7.widget.CardView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_margin="4dp"
                            android:layout_weight="0.5"
                            app:cardBackgroundColor="@color/silver">


                        </android.support.v7.widget.CardView>

                    </LinearLayout>

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

android android-cardview

1
推荐指数
1
解决办法
1622
查看次数