我使用包含Clickable TextView的LinearLayout创建了一个导航栏,对于包含LinearLayout我设置了一个背景形状XML来创建圆角,问题是,当用户点击其中一个选项卡我设置为标签颜色背景时,圆角覆盖,我在容器中而不是在标签中设置圆角的原因是因为左右\左右语言.
点击之前
点击后
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:background="@drawable/rounded_corners"
android:layout_height="40dp"
android:layout_margin="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textColor="@color/registerButton"
android:gravity="center"
android:text="A"/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/registerButton">
</View>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/registerButton"
android:text="B"/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/registerButton">
</View>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textColor="@color/registerButton"
android:gravity="center"
android:text="C"/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/registerButton">
</View>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textColor="@color/registerButton"
android:gravity="center"
android:text="D"/>
Run Code Online (Sandbox Code Playgroud)
@绘制/ rounded_corners
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF"/>
<stroke android:width="1dip" android:color="@color/registerButton" />
<corners android:radius="8dip"/>
<padding android:color="@color/registerButton"
android:left="0dip"
android:top="0dip"
android:right="0dip"
android:bottom="0dip" />
</shape>
Run Code Online (Sandbox Code Playgroud) 我可以在量角器/茉莉花中创建嵌套吗?
it("outer it", function () {
it("inner it", function () {
expect(1).toBe(1);
});
});
Run Code Online (Sandbox Code Playgroud)
我试图在一个循环内执行它的测试用例,并且在每个迭代中我都想运行一个测试,例如:
it("outer it", function () {
for(var i=0;i<10;i++){
it("inner it", function () {
expect(1).toBe(1);
});
}
});
Run Code Online (Sandbox Code Playgroud)
我要这样做的原因是,我想初始化一个数组,然后以一种动态的方式循环遍历所有元素并运行多个“ it”,例如:
describe ("[Components]", function() {
var grid = new Grid();
it("Initialize the grid for the history window", function () {
grid.init();
});
for(var i=0;i<grid.length;i++){
it("test 1", function () {
expect(1).toBe(1);
});
}
Run Code Online (Sandbox Code Playgroud)
});
当for循环执行时,grid.length等于0,我希望for循环在初始化“ it”之后执行。
我想使用 CSS 创建带有重复图像的背景
background: url(../images/bg.PNG) repeat;
Run Code Online (Sandbox Code Playgroud)
问题是图像彼此非常接近,如何为每个图像添加填充?