android-framelayout

Frame layout not adjusting layout weight

丶灬走出姿态 提交于 2019-12-23 20:21:28
问题 Here is the code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="5dp" android:layout_marginLeft="5dp" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="1"> <RelativeLayout android:id="@+id/rlengword" android:layout_width="wrap_content"

Can't make a view overlay another view in FrameLayout

无人久伴 提交于 2019-12-23 11:49:11
问题 I want to make my ImageView on top of my Button, but the button will always overlay the ImageView , no matter which layout I choose or the way I arrange my layout... this is an example of a FrameLayout that I tried: EDIT: just for simplifying my question : Why doesn't the FrameLayout work as it should? (you can copy this code to your Android Studio and see yourself) <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout

FrameLayout click event is not firing

久未见 提交于 2019-12-23 07:26:17
问题 I have used Framelayour for click event and It was working fine before 2 days but don't know wat happend now it is not working. Please someone help me. My code is as below : Design : <FrameLayout android:id="@+id/flWebpre" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" > <WebView android:id="@+id/wvWebsite" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <ProgressBar android:id="@+id/pbWebsite" android:layout_width="wrap

Camera Preview stretched when using FrameLayout

谁都会走 提交于 2019-12-23 05:44:05
问题 I have found that the CameraPreview is displayed in a small area when I use the PreviewFrameLayout and is stretched when I use the aspect ratio and the FrameLayout . Here is the code that I currently use to set the Camera Preview and the FrameLayout size: private Size getOptimalPreviewSize(Activity currentActivity, List<Size> sizes, double targetRatio) { // Use a very small tolerance because we want an exact match. final double ASPECT_TOLERANCE = 0.001; if (sizes == null) return null; Size

android - overlap images (playing cards)

我们两清 提交于 2019-12-22 05:33:19
问题 I am trying to make the playing cards in my game overlap such that only the first half of a card is seen and the other half is covered by the next playing card. The only card that should be completely visible will be the last/rightmost card. I have used the following code with both framelayout and relativelayout to no avail. can anyone offer some suggestions? public int shouldShow(int numberOfCards, int card, int id) { if(card == -1) hide(id); else { findViewById(id).setBackgroundDrawable

Programmatically adding fragment to framelayout in android

烂漫一生 提交于 2019-12-22 01:26:37
问题 I am trying to build a UI combining both static and dynamic elements. For this, I have divided my activity into fragments - all app navigation is then done by replacing fragments instead of navigating between activities. In my main activity layout, I am using a FrameLayout : <FrameLayout android:id="@+id/mainframe" android:layout_height="match_parent" android:layout_width="match_parent" android:layout_below="@id/topsection" android:layout_above="@id/lowersection" /> I have a fragment declared

Create Layout Programmatically in android - issue

烈酒焚心 提交于 2019-12-21 07:56:14
问题 I am creating FrameLayout dynamically using the following code mylayout.java FrameLayout layout = new FrameLayout(this); FrameLayout.LayoutParams layoutparams=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT,Gravity.CENTER_HORIZONTAL|Gravity.CENTER_VERTICAL); layout.setLayoutParams(layoutparams); webview=new WebView(this); webview.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH

Warning: This <FrameLayout> can be replaced with a <merge> tag

青春壹個敷衍的年華 提交于 2019-12-20 17:33:18
问题 I have a FrameLayout that contains a TextView and two LinearLayout s: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > ... a textview and 2 linearlayouts </FrameLayout> After running Android Lint, I get this warning: This <FrameLayout> can be replaced with a <merge> tag. Why does this warning exist? What can I do to fix it (other than ignore)? 回答1: To understand this, you need to understand how

Overlay image over another android

眉间皱痕 提交于 2019-12-20 14:35:18
问题 I have photo album which shows the image as rounded with white border. Image will be adding dynamically. I tried frame layout but it it not working for me. My try : Adding dynamic image over already existing round shape image.. <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/image" android:layout_width="60dip" android:layout_height="60dip" android:adjustViewBounds="true" android:scaleType="centerCrop" /> <ImageView android:id="@

How to add two fragments together in a frameLayout in runtime

情到浓时终转凉″ 提交于 2019-12-20 03:18:11
问题 I am developing an andorid application with navigation drawer and I have a layout for contentview like this: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- As the main content view, the view below consumes the entire space available using match_parent in both dimensions. --> <FrameLayout xmlns:android="http://schemas.android.com/apk