android-layout

App showing “Display in this area” while opening

北战南征 提交于 2021-02-11 15:31:36
问题 I am facing little problem in my android app. When i open my android app in new notched android devices, There is a blank space at bottom of the app displaying the text " Display in this area " as shown in the screenshot. Here is main xml <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:background="#fffafafa" android:fitsSystemWindows="true" android:scrollbars="none

Wave curve in android studio

て烟熏妆下的殇ゞ 提交于 2021-02-11 14:30:18
问题 Hi friends can anyone please help me in this. i want to create a login page in this way But it is not working in emulator and android 8 phone. it is working in android 5 phone. Working fine if i remove the image view which contains curve. getting this error when i try in android 8 or emulator. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.loginapi/com.example.loginapi.views.Loginactivity}: android.view.InflateException: Binary XML file line #11 in com.example

How to move a view (button) programmatically in a constraint layout?

徘徊边缘 提交于 2021-02-11 14:26:39
问题 I'm trying to create a simple timetable, (I'm a beginner). I have created a basic layout for the timetable with 7 days and 24 hours, and my idea was to insert buttons programmatically, overlaying the timetable for the correct time and duration by manipulating the position and width of the buttons, so that when clicked they display the task saved in the textview below as such: I know how to create the buttons but after hours of searching for a working method to change their size and location

colorControlNormal not setting toolbar back arrow color

℡╲_俬逩灬. 提交于 2021-02-11 12:50:15
问题 I'm trying to change the color of my toolbar's back arrow to purple, but the color I set for the colorControlNormal attribute of my custom toolbar theme isn't working. The toolbar should be purple but it remains white. I've checked all over my layout's xml and the app Manifest to see if my toolbar theme is being overidden somewhere but i don't see this. What's the problem? styles.xml <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!--

android layout images bad quality

左心房为你撑大大i 提交于 2021-02-11 12:46:24
问题 when I add images on layout it show in bad quality <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/sbackground" /> how to fix it? (I need to fix it only without programmatically) thanks 回答1: i think your images are stretching

android layout images bad quality

我的梦境 提交于 2021-02-11 12:44:59
问题 when I add images on layout it show in bad quality <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/sbackground" /> how to fix it? (I need to fix it only without programmatically) thanks 回答1: i think your images are stretching

Why my dialog layout wont spread correctly?

心已入冬 提交于 2021-02-11 12:35:05
问题 In my layout (its layout for custom dialog class), whenever I set my layout attributes like this : android:layout_width="match_parent" android:layout_height="match_parent" I don't see a layout that spreads all over the screen, I see it like this: As you can see, the dialog is very small and weird looking although I am using match_parent , the weird part is that whenever I use fixed size I see it normally. For example - for those attributes: android:layout_width="300dp" android:layout_height=

Why my dialog layout wont spread correctly?

心不动则不痛 提交于 2021-02-11 12:34:09
问题 In my layout (its layout for custom dialog class), whenever I set my layout attributes like this : android:layout_width="match_parent" android:layout_height="match_parent" I don't see a layout that spreads all over the screen, I see it like this: As you can see, the dialog is very small and weird looking although I am using match_parent , the weird part is that whenever I use fixed size I see it normally. For example - for those attributes: android:layout_width="300dp" android:layout_height=

How to set initial height of CollapsingToolbar without flickering?

痴心易碎 提交于 2021-02-11 12:30:03
问题 I am using a CollapsingToolbar with a NestedScrollView in my layout and I want to display it with half its height when the activity is initially shown, i.e. I want to simulate a scrolling event. I achieved this by dispatching a nested scroll in my activity's onCreate() method. @Override protected void onCreate(Bundle savedInstanceState) { ... NestedScrollView nestedScrollView = findViewById(R.id.scroll_view); nestedScrollView.post(() -> { int appBarHeight = findViewById(R.id.app_bar)

HDMI Screen resolution issue while displaying android content?

旧巷老猫 提交于 2021-02-11 12:26:54
问题 I design an very simple application just to calculate Height and Width of display screen. I am using HDMI display that running on full-HD 1920x1080. But when I am calculating display size I am just getting half-HD resolution i.e. 720x1080. I am using WindowManager/DisplayMetrics for calculating window size. any one have any idea about why it responding half of display device resolution. 回答1: Maybe even though the device uses 1920x1080 display output, to the screen by hardware, it is just