我只想创建一个自定义背景,但我不知道如何使用 xml 而不是图像来做到这一点。
这是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"
android:background="@layout/ui_shape"
tools:context="${relativePackage}.${activityClass}" >
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
我想要这样。是否可以像所需的图像一样创建 xml?
这是 ui_shape
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
>
<item>
<rotate
android:fromDegrees="45">
<shape
android:shape="line" >
<stroke android:color="@color/ui" android:width="1dp" />
<solid
android:color="@color/ui" />
</shape>
</rotate>
</item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)
和颜色
<color name="ui">#0095A0</color>
Run Code Online (Sandbox Code Playgroud)
这是我得到的
有人知道吗?
我想将一个字符串分成两部分,以便我可以获取文件路径和文件名.
这是我的文件路径......
String totalString = "/mnt/sdcard/PDF/abc.pdf"
String filename = "";String filePath = "";
filename = totalString.substring(files.lastIndexOf("/")+1);
Run Code Online (Sandbox Code Playgroud)
filePath =?
我没有得到如何获取filePath ="/ mnt/sdcard/PDF /"?
怎么做?
我试图定义预定义的功能,它给了我错误...下面的编程有什么问题.有人告诉我,我可以定义预定义的功能.我知道这不正确,但我仍在张贴......如果有人有......
#include <stdio.h>
#include <stdlib.h>
#define scanf "%s abc";
int main()
{
printf(scanf,scanf);
return 0;
}
Run Code Online (Sandbox Code Playgroud) 我试图在 Kotlin 中创建List<Char>
,String
但似乎 lib 没有提供内置函数。铸造也会产生错误。所以这就是我正在做的。如果我遗漏了有问题的内容,请告诉我。(或者我们可以说List<Char>
在 Kotlin中将字符串转换为)。
var stringVal = "ABC"
var genList:List<Char> = arrayListof()
var count = 0
while (stringVal.length == genList.size) {
// way to add stringVal to genList
count++
}
Run Code Online (Sandbox Code Playgroud) android ×2
c ×1
collections ×1
definition ×1
java ×1
kotlin ×1
logic ×1
split ×1
string ×1
xml ×1