我只是想这样做,但我不知道如何。这将是垂直线性布局。我搜索了3个小时,还没有发现任何有用的东西。半屏Android视图
3
A
回答
2
我之前做过2个网页浏览。我通过将android:layout_weight设置为1来实现这两种视图,并且它填满了屏幕。
如果您只想要1个网页视图,请为其余项目使用另一个线性布局,并将android:layout_weight =“1”设置为webview和线性布局。
0
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:weightSum="1">
Web浏览器按钮
button = (Button) findViewById(R.id.btn_webbrowser);
button.setOnClickListener(new OnClickListener()
{
public void onClick(View arg0){
Intent i = new
Intent(android.content.Intent.ACTION_VIEW,
Uri.parse(“http://www.amazon.com”));
startActivity(i);
}
});
5
设置等于对方你的孩子浏览的权重应该平分他们:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<WebView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<Space
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
+0
谢谢你正确的例子,但nithinreddy回答了第一个,所以我必须检查他的。 –
相关问题
- 1. 半屏视图vs viewController
- 2. Android半屏活动
- 3. 如何呈现半屏模态视图?
- 4. 调整视图重叠半个屏幕
- 5. Android MapView半屏白错误
- 6. Android如何划分半屏?
- 7. Android 2图像视图,左半侧半显示,右半侧显示
- 8. AFreeChart Android全屏视图
- 9. 模态视图在iPad的屏幕右半部分?
- 10. 显示从顶部向下滑动的半屏视图
- 11. 如何设置屏幕高度一半的视图?
- 12. 如何在Xamarin表单中创建半屏相机视图
- 13. 将Android屏幕分成两半等分
- 14. 仅在半屏上显示Android WebView
- 15. 多点触摸android froyo半屏
- 16. Android AutoCompleteTextView建议出现半屏
- 17. 半屏TabHost
- 18. 半屏活动
- 19. 响应式网站只占用iPad屏幕平板视图的一半屏幕
- 20. UISwipeGestureRecognizer的视图的一半
- 21. xml视图的半径角
- 22. 如何在Motorola Atrix上运行android应用程序时启用半屏大小的全屏视图?
- 23. 在地图视图中绘制一定半径的圆圈android
- 24. 如何在Android视图中添加半透明覆盖图?
- 25. Android微调器全屏视图
- 26. Android视图和屏幕取向
- 27. Android:拖动视图在屏幕外
- 28. 全屏Android软键盘表面视图
- 29. Android中的屏幕和视图坐标
- 30. Android - 自定义视图显示黑屏
退房这个问题:http://stackoverflow.com/问题/ 4315332/how-to-create-two-views-in-android-that-use-50-height-each-unless-one-is-small – jorgenfb
@Tomi S:你好我正面临着像...... if我打开google.com或在网络视图(高度= 200dp)中说yahoo.com,它显示第一个200dp空白的网页视图,然后打开谷歌/雅虎页面全屏...我只是尝试与www.ya.com,它为我工作...在这里的任何帮助? – CoDe
在这里相同...如果我点击任何链接,然后它打开一个新的全屏页面,而不是打开在相同的200dp高度webview ....任何想法在这? – CoDe