首页 \ 问答 \ 如何重复圆角?(How to have rounded corners with repeat?)

如何重复圆角?(How to have rounded corners with repeat?)

我正在尝试重复按钮。 我可以重复常规背景类型。 但我无法使用repeat xml文件找到右,左和中心。

如果您对xml文件有所了解,请帮助我。

提前致谢

我使用的重复xml文件是

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
        <bitmap
            android:src="@drawable/barslice"
            android:tileMode="repeat"
            android:dither="true"/>
</item>

我需要的按钮是: 离开了

中央

右上角

我需要的完整按钮


I am trying for repeat for buttons. I am able to get repeat for regular background type. But i was not able to find right, left and center using the repeat xml file.

If you know some solution with the xml file please help me.

Thanks in advance

The repeat xml file i have used is

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
        <bitmap
            android:src="@drawable/barslice"
            android:tileMode="repeat"
            android:dither="true"/>
</item>

The button i require is: left conrner

center

right corner

complete button i require


原文:https://stackoverflow.com/questions/9172288
更新时间:2022-06-20 19:06

最满意答案

创建一个具有值结构的类,这些结构对于您在结果页面上使用非常有用。 然后,当用户单击它是什么时,他们单击以转到结果页面,循环访问DataList,从选中的项目创建一个集合,当您需要格式化查询时,您只需要抓取一个对象而不是所有对象。

然后,当您到达结果页面时,循环访问集合并在循环中构建查询。 非常简单,代码也不多。


Make a class with a structure for your values that will be useful and easy for you to use on the result page. Then when the user clicks whatever it is they click to go to the result page, loop through the DataList, create a collection from the checked items, and you will only need to grab one object instead of everything, when you need to format your query.

Then when you get to the result page, loop through the collection and build the query in the loop. Pretty easy and not much code.

相关问答

更多
  • Items 介绍和作用 Items是DataGridItem的集合,可以遍历当前DataGrid中显示数据的DataGridItem。 5.1、DataGridItem 每一个DataGridItem就是DataGrid中显示的一行,其中包括: Header DataGrid 控件的标题部分 Item DataGrid 控件中的项 AlternatingItem DataGrid 控件中的交替项 SelectedItem DataGrid 控件中的选定项(由SelectedIndex设置,通过Selecte ...
  • 创建一个具有值结构的类,这些结构对于您在结果页面上使用非常有用。 然后,当用户单击它是什么时,他们单击以转到结果页面,循环访问DataList,从选中的项目创建一个集合,当您需要格式化查询时,您只需要抓取一个对象而不是所有对象。 然后,当您到达结果页面时,循环访问集合并在循环中构建查询。 非常简单,代码也不多。 Make a class with a structure for your values that will be useful and easy for you to use on the re ...
  • 使用PreviousPage.FindControl()当有人从Page A —> Transfer Data —> Page B导航时,只能访问PreviousPage数据。 如果直接请求页面,则PreviousPage呈现空引用。 在这种情况下,在您的情况下,一旦导航到页面Default2您只能在页面加载时保持值。 单击后提交Default.aspx调用本身,而PreviousPage丢失数据。 此外,您找到控制的方式也不正确,因为您将获得NULLREFERENCE 。 更多信息 如果您的Web应用程序 ...
  • 您可以使用CheckBox的CheckedChanged事件并将其NamingContainer为DataListItem ,您只需使用FindControl查找不同的服务器控件: protected void CheckBoxPN_CheckedChanged(Object sender, EventArgs e) { CheckBox chk = (CheckBox) sender; DataListItem item = (DataListItem) chk.NamingContain ...
  • 如果你想进行服务器端验证,
  • 如果list_str确实没问题,那么你的代码就可以了。 你可以在jsFiddle上查看它。 您描述的行为的最一般原因是您的代码刷新页面。 如果从链接小提琴中的“更改选项”按钮中删除type="button" ,则会出现错误(由于小提琴本身)。 在你的页面中,你可能有类似的东西调用populate_datalist_from_array() 。 请注意,同时在活动文本输入上按Enter键将执行提交/刷新。 If list_str really is OK, your code works. You can c ...
  • 您可以使用TempData存储您的下一个请求将需要访问的对象,这是我避免在序列页面之间传递大块数据的方式。 You can use TempData to store an object that your next request will need access to, this is how I avoid passing big lumps of data between sequence pages.
  • 你可能需要在适当的时候调用DataBind()方法,这是在加载这两个单独的数组之后 DataList1.DataBind(); DataList2.DataBind(); 如果我找到你的话应该可以正常工作 protected void dlstImage_ItemDataBound(object sender, DataListItemEventArgs e)// for disabling the image after moving { ImageButton imgctrl = ...
  • sender是按钮,它的NamingContainer是DataListItem : protected void imgbtn_Click(object sender, ImageClickEventArgs e) { var imgbtn = (ImageButton) sender; var item = (DataListItem) imgbtn.NamingContainer; // the datasource is not available on postbac ...
  • 您可以使用input元素上的pattern属性来限制允许的值: ​