navigationitem

Add custom shape ripple with selector on navigationview menu item

假装没事ソ 提交于 2021-02-10 05:47:28
问题 I want to add a ripple effect with rounded corners rectangle with a selector for navigation view item. But it keeps adding the gray rectangle ripple effect. navigation view <android.support.design.widget.NavigationView android:id="@+id/navigation_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" app:itemIconTint="@color/drawer_item" app

iOS开发的技巧和经验总结(系列三)

杀马特。学长 韩版系。学妹 提交于 2020-03-01 08:41:14
1、iOS7添加NavigationItem,不能通过手指向左滑动pop到前一个页面 在iOS7中,由当前页面ViewController1 push到新的页面ViewController2的时候,我们可以通过滑动手指来返回到前一个页面,这是iOS7内置的新特性,效果如下图所示, 但是,当我们在给ViewController添加self.navigationItem的时候,就不能通过手指来滑动回去了,本来我没有注意到这个问题,后来leader要我能够解决这个bug,有没有觉得这个问题该怎么在google上面提问都不知道,我找了半天,在 stackoverflow 找到了答案,就是在viewDidAppear和viewDidDisappear添加如下代码,就是delegate的设置, - ( void )viewDidAppear:( BOOL )animated { [ super viewDidAppear :animated]; self . navigationController . interactivePopGestureRecognizer . delegate = self ; } - ( void )viewDidDisappear:( BOOL )animated { [ super viewDidDisappear :animated]; self .

in Swift4, replacement of navigationItem.leftBarButtonItem resizes unwanted

旧巷老猫 提交于 2019-12-25 12:43:40
问题 Having a problem with UIBarButtonItem resizing when returning to VC with different values for frame and image. var selectedR = 1 var leftFrame = CGRect() var leftImage = UIImage() override func viewDidLoad() { super.viewDidLoad() if selectedR == 0 { leftFrame = CGRect(x: 0, y: 0, width: 33, height: 33) leftImage = UIImage(named: “pic-0”)! } else if selectedR == 1 { leftFrame = CGRect(x: 0, y: 0, width: 79, height: 33) leftImage = UIImage(named: "pic-1")! } else if selectedR == 2 { leftFrame =

Xcode 4 Navigation item prompt property misbehaving?

回眸只為那壹抹淺笑 提交于 2019-12-24 10:01:41
问题 When designing in Interface Builder and you add text to a prompt property, it creates an additional top title. This comes with the extra thickness needed to allow for 2 tiles in the navigation bar. Once I remove the text, let's say to reset back to the way it was, it keeps that thickness even though there is no text there. At runtime switching views makes the bar grow and shrink, which isnot nice. My question is, how do you reset this back to a default single line thickness bar? Thank you Jim

UIBarButtonItem color setting in Swift-5.0

时光总嘲笑我的痴心妄想 提交于 2019-12-11 18:03:46
问题 I realised that the color-behaviour of my UIBarButtonItem's (left and right buttons) is not as desired. If I press and hold the right UIBarButton (see video), then the color changes from light-yellow to gray'isch dark-yellow. However, I would like a solution that keeps the same light-yellow color, no matter of any button selection, press-and-hold, etc. The button color should always stay the same light-yellow. How can I achieve this ? Here is the video done in Simulator: (you can clearly see

Navigation item's title disappeared when clicked

妖精的绣舞 提交于 2019-12-07 10:34:43
问题 I have created drawer with navigation view. I have Navigation item's on which I am calling other activities. The issue is when I click on navigation item, the other activity launches,and if I come back to main activity and open a drawer the clicked navigation item's title is disappeared only I can see the icon of the item. code: public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { @Override protected void onCreate(Bundle

Navigation item's title disappeared when clicked

柔情痞子 提交于 2019-12-05 12:21:07
I have created drawer with navigation view. I have Navigation item's on which I am calling other activities. The issue is when I click on navigation item, the other activity launches,and if I come back to main activity and open a drawer the clicked navigation item's title is disappeared only I can see the icon of the item. code: public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar =

Black bar appears under navigation bar

夙愿已清 提交于 2019-12-04 22:59:13
问题 There are several similar questions which got no answers but were describe vaguely. I have reduced the problem into a very thin application, and added detailed screenshots. I would highly appreciate a solution for this! The only involved code is one line added to viewDidLoad of the root VC. The purpose of this line is to make the navigation controller opaque: - (void)viewDidLoad { [super viewDidLoad]; self.navigationController.navigationBar.translucent = NO; } A critical information for this

iOS 11 navigationItem.titleView Width Not Set

让人想犯罪 __ 提交于 2019-11-28 18:31:32
Seeing a behavior on iOS11 with a navigationItem.titleView where the width of the titleView is not the full width of the screen. I have a custom view that I set as the titleView. Previous to iOS11 the view would fill the navigation bar area. But iOS 11 it is not resizing to fill the width of the screen. I've tried setting the frame of the view before setting titleView but no luck. I've tried to force the titleViews superview to layout constraints as well but no luck. Screenshots attached: iOS10: iOS11: Anyone else experience this? gngrwzrd I figured it out. I had to override the

iOS 11 navigationItem.titleView Width Not Set

倖福魔咒の 提交于 2019-11-27 11:38:15
问题 Seeing a behavior on iOS11 with a navigationItem.titleView where the width of the titleView is not the full width of the screen. I have a custom view that I set as the titleView. Previous to iOS11 the view would fill the navigation bar area. But iOS 11 it is not resizing to fill the width of the screen. I've tried setting the frame of the view before setting titleView but no luck. I've tried to force the titleViews superview to layout constraints as well but no luck. Screenshots attached: