安卓开发,如何把RadioButton文字区域隐藏 15
我设置了drawableTop属性,文字在下面,但是不加任何文字,这块区域一直有,我想把它去掉,只显示图片,并且让图片充满整个RadioButton的区域已经解决了,把字...
我设置了drawableTop属性,文字在下面,但是不加任何文字,这块区域一直有,我想把它去掉,只显示图片,并且让图片充满整个RadioButton的区域
已经解决了,把字体的大小设为0就好了 展开
已经解决了,把字体的大小设为0就好了 展开
3个回答
推荐于2018-05-01 · 知道合伙人金融证券行家
关注
展开全部
用Jquery写的,可以实现隐藏功能,代码如下:
1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JqueryRadioButton.aspx.cs" Inherits="HtmlAgilityPackHtml.JqueryRadioButton" %>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml">
6 <head runat="server">
7 <title>点击RadioButton</title>
8 <script src="jquery-1.5.2.min.js" type="text/javascript"></script>
9 <style type="text/css">
10 .hideclass
11 {
12 display:none;
13 }
14 </style>
15 <script type="text/javascript" language="javascript">
16 $(function () {
17 $("#RadioButton1").change(function () {
18 $("#tr1").removeClass("hideclass");
19 $("#tr2").addClass("hideclass");
20 })
21
22 $("#RadioButton2").change(function () {
23 $("#tr1").addClass("hideclass");
24 $("#tr2").removeClass("hideclass");
25 })
26
27 });
28 </script>
29 </head>
30 <body>
31 <form id="form1" runat="server">
32 <div>
33 <table>
34 <tr>
35 <td>链接类型:</td>
36 <td colspan="2">
37 <asp:RadioButton ID="RadioButton1" runat="server" Text="图片链接" GroupName="rdo" Checked="true"/>
38 <asp:RadioButton ID="RadioButton2" runat="server" Text="文字链接" GroupName="rdo" />
39 </td>
40 </tr>
41 <tr id="tr1">
42 <td><asp:Label ID="Label1" runat="server" Text="链接图片:"></asp:Label></td>
43 <td>
44 <asp:FileUpload ID="FileUpload1" runat="server" />
45 <asp:Button ID="Button1" runat="server" Text="上传" />
46 </td>
47 </tr>
48 <tr id="tr2" class="hideclass">
49 <td><asp:Label ID="Label2" runat="server" Text="文字链接:"></asp:Label></td>
50 <td>
51 <asp:TextBox ID="TextBox2" runat="server" ></asp:TextBox>
52 </td>
53 </tr>
54 </table>
55 </div>
56 </form>
57 </body>
58 </html>
1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JqueryRadioButton.aspx.cs" Inherits="HtmlAgilityPackHtml.JqueryRadioButton" %>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml">
6 <head runat="server">
7 <title>点击RadioButton</title>
8 <script src="jquery-1.5.2.min.js" type="text/javascript"></script>
9 <style type="text/css">
10 .hideclass
11 {
12 display:none;
13 }
14 </style>
15 <script type="text/javascript" language="javascript">
16 $(function () {
17 $("#RadioButton1").change(function () {
18 $("#tr1").removeClass("hideclass");
19 $("#tr2").addClass("hideclass");
20 })
21
22 $("#RadioButton2").change(function () {
23 $("#tr1").addClass("hideclass");
24 $("#tr2").removeClass("hideclass");
25 })
26
27 });
28 </script>
29 </head>
30 <body>
31 <form id="form1" runat="server">
32 <div>
33 <table>
34 <tr>
35 <td>链接类型:</td>
36 <td colspan="2">
37 <asp:RadioButton ID="RadioButton1" runat="server" Text="图片链接" GroupName="rdo" Checked="true"/>
38 <asp:RadioButton ID="RadioButton2" runat="server" Text="文字链接" GroupName="rdo" />
39 </td>
40 </tr>
41 <tr id="tr1">
42 <td><asp:Label ID="Label1" runat="server" Text="链接图片:"></asp:Label></td>
43 <td>
44 <asp:FileUpload ID="FileUpload1" runat="server" />
45 <asp:Button ID="Button1" runat="server" Text="上传" />
46 </td>
47 </tr>
48 <tr id="tr2" class="hideclass">
49 <td><asp:Label ID="Label2" runat="server" Text="文字链接:"></asp:Label></td>
50 <td>
51 <asp:TextBox ID="TextBox2" runat="server" ></asp:TextBox>
52 </td>
53 </tr>
54 </table>
55 </div>
56 </form>
57 </body>
58 </html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询