小编Ver*_*kis的帖子

Android WebView背景色

我在我的布局中添加了一个WebView来显示对齐的文本.我想将WebView的背景设置为透明,使其看起来像textView.这是我做的:

WebView synopsis;
synopsis=(WebView)findViewById(R.id.synopsis);
synopsis.setBackgroundColor(0x00000000);
Run Code Online (Sandbox Code Playgroud)

它适用于模拟器,但是当我在我的设备上运行应用程序时它不起作用:我得到的是白色背景.

 String textTitleStyling = "<head><style>* {margin:0;padding:0;font-size:20; text-align:justify; color:#FFFFFF;}</style></head>";
 String titleWithStyle = textTitleStyling + "<body><h1>" + movie.synopsis + "</h1></body>";
 synopsis.loadData(textTitleStyling + movie.synopsis, "text/html", "utf-8");
 synopsis = (WebView) findViewById(R.id.synopsis);
 synopsis.getSettings();
 synopsis.setBackgroundColor(0);
Run Code Online (Sandbox Code Playgroud)

android background-color webview

46
推荐指数
3
解决办法
5万
查看次数

在相同的选项卡中启动下载,而无需在Javascript中打开新选项卡或窗口

我正在使用这个javascript函数来启动下载

function startDownload(url) {
   window.open(url, 'Download');
}
Run Code Online (Sandbox Code Playgroud)

它工作,但我想阻止任何新的选项卡或新窗口启动,谢谢.

javascript download

22
推荐指数
4
解决办法
5万
查看次数

将Android SDK设置在服务器代理后面?

如何在服务器代理后面下载android sdk包?

proxy android

19
推荐指数
3
解决办法
3万
查看次数

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

从javascript调用C#webservices并使用它(json格式)

我已经创建了ac#webservice,我正在尝试调用它并从javascript脚本中使用它,这是什么方式或最好的方法,提前感谢.我将解释更多:这是Web服务:

 public class DocumentInfo : System.Web.Services.WebService
{

    [WebMethod(EnableSession = true)]
    [ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Json)]
    public string GetDocumentInfo(string id)
    {
        Document document = new Document(Int32.Parse(id));    
        string output = JsonConvert.SerializeObject(document);
        return output;
    }
}
Run Code Online (Sandbox Code Playgroud)

我测试了它,它的工作原理,当我尝试建议的ajax解决方案时,我收到此错误500内部服务器错误.

javascript c# web-services

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

ASP.NET添加httphandler来编辑下载的文件名

我在我的项目中有一个页面DownloadDocument.aspx,它的代码隐藏是DownloadDocument.aspx.cs

在我的DownloadDocument.aspx我有一个锚点,采取这样的动态链接:

<a id="downloadLink" runat="server"  style="margin:5px" 
href="<%# CONTENT_DIRECTORY_ROOT + document.Path %>">Download current file</a>
Run Code Online (Sandbox Code Playgroud)

我想添加一个httphandler来控制下载的文件名,我该怎么做?提前致谢.

c# asp.net anchor httphandler

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

从子视图中删除阴影

我有一个UIView mainView,我在每个角落添加了4个按钮作为子视图.我像这样在我的mainView中添加了阴影

mainView.layer.shadowColor = [[UIColor blackColor] CGColor];
mainView.view.layer.shadowOffset = CGSizeMake(0,6);
mainView.layer.shadowOpacity = 0.3;
Run Code Online (Sandbox Code Playgroud)

我的问题是子视图也显示阴影(按钮).如何隐藏子视图阴影.提前致谢.

objective-c layer shadow subview uiview

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

Android SDK设置代理与ubuntu

我在哪里可以找到android SDK代理设置?

我正在与ubuntu合作,提前谢谢.

我所拥有的只是在屏幕下方

在此输入图像描述

ubuntu proxy android setting

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

缩放库中的选定图像

我怎样才能缩放图库中的所选图像,我试过这个,但它不能很好地工作.`

public void  onItemSelected  (AdapterView<?>  parent, View  v, int position, long id) 
{
    Animation grow = AnimationUtils.loadAnimation(DetailTvShow.this, R.anim.grow);

            Button btn = (Button)findViewById(R.id.button1);
            btn.setText("saison "+(position+1));
            View sideView = v.findViewById(position + 1);
            View sideView1 = v.findViewById(position - 1);

           if ((sideView != null)||(sideView1 != null)){
               ((ImageView)sideView).setLayoutParams(new Gallery.LayoutParams(80, 115));

               ((ImageView)sideView1).setLayoutParams(new `enter code here`Gallery.LayoutParams(80, 115));

           }

      /*      sideView = parent.findViewById(position + 1);
          if (sideView != null)
               ((ImageView)sideView).setLayoutParams(new Gallery.LayoutParams(80, 115));  */

            v.startAnimation(grow);
            v.setLayoutParams(new Gallery.LayoutParams(105, 140));
        }`
Run Code Online (Sandbox Code Playgroud)

android gallery

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

Android如何更改gridview高亮颜色?

如何在gridview中更改imageView的高亮颜色.

我试过这个,

 public View getView(int position, View convertView, ViewGroup parent) {

    ImageView imageView;
    if (convertView == null) {  // if it's not recycled, initialize some attributes
        imageView = new ImageView(mContext);
        imageView.setLayoutParams(new GridView.LayoutParams(width, height));
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        imageView.setBackgroundResource(R.drawable.menu_beh);
     //   imageView.setPadding(8, 8, 8, 8);
    } else {
        imageView = (ImageView) convertView;
    }

    String s=(String)HiveApp.mgd[position].posters[2].image.url;
 //   imageView.setImageDrawable(getPicture(items[position]));
   HiveApp.id.download(s, imageView); 


  //     id.DisplayImage(s, imageView);

    return imageView;
}
Run Code Online (Sandbox Code Playgroud)

android gridview colors highlight

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

Android屏幕左侧的垂直菜单

我想创建一个菜单,它来自屏幕左侧,经典菜单来自onclick菜单按钮上的屏幕底部,有没有办法让它垂直并从左边来.

android menu

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