本文整理汇总了Java中android.widget.TableRow.removeAllViews方法的典型用法代码示例。如果您正苦于以下问题:Java TableRow.removeAllViews方法的具体用法?Java TableRow.removeAllViews怎么用?Java TableRow.removeAllViews使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.TableRow
的用法示例。
在下文中一共展示了TableRow.removeAllViews方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: inflateMoreOrLess
import android.widget.TableRow; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private void inflateMoreOrLess() {
TableRow tr=(TableRow)findViewById(R.id.creditsRow);
TextView tv=(TextView ) findViewById(R.id.more);
tr.removeAllViews();
if(!isMore)
{
WebView webView=new WebView(activity);
WebSettings webSettings=webView.getSettings();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
webSettings.setTextZoom(50);
else
webSettings.setTextSize(WebSettings.TextSize.SMALLEST);
webSettings.setJavaScriptEnabled(false);
//webSettings.setSupportZoom(true);
webSettings.setBuiltInZoomControls(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl(activity.getString(R.string.creditsURL));
tr.addView(webView);
/* TextView moreTV=new TextView(activity);
StringBuilder sb=new StringBuilder();
try
{
InputStreamReader isr=new InputStreamReader(activity.getResources().getAssets().open("FullCredits.html"));
int ch;
do
{
ch=isr.read();
if(ch!=-1)
sb.append((char )ch);
}
while(ch!=-1);
isr.close();
}
catch(Exception e)
{
Log.v(TAG, "Error reading FullCredits.html", e);
}
// moreTV.setAutoLinkMask(Linkify.WEB_URLS);
moreTV.setWidth(LinearLayout.LayoutParams.FILL_PARENT);
moreTV.setText(Html.fromHtml(sb.toString()));
tr.addView(moreTV);*/
tv.setText(Html.fromHtml(activity.getString(R.string.lessURL)));
}
else
{
tv.setText(Html.fromHtml(activity.getString(R.string.moreURL)));
}
return;
}